...

View Full Version : Object invalid or no longer set.



phill_ridout
03-30-2006, 05:10 PM
ok, im trying to add a record to an access databse using a stored query, but i am getting this error come up


The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the localhost home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80004005)
Object invalid or no longer set.
/forum4/signupnow.asp, line 124


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; FunWebProducts; SV1; FunWebProducts-MyWay; .NET CLR 1.1.4322)

Page:
POST 429 bytes to /forum4/signupnow.asp

POST Data:
lasturl=http%3A%2F%2Flocalhost%2Fforum4%2F&name=Name&usr_gender=1&dob_day=1&dob_month=1&dob_year=2006&usr_twn=Some+Town&usr_post_code=POST&country=214&Email=email@email.com&usr_name=user+name&password . . .

Time:
30 March 2006, 18:05:42


More information:
Microsoft Support



and the code im using to execute this stored query is:


Function addtodb()
addtodb = True

' ADO Constants
Const adCmdTableDirect = &H0200

' Connection String
Dim connStr
connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb")

' Recordset Object
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "exec Add_New_User '" & request("usr_name") & "', '" & request("name") & "', '" & request("email") & "', '" & Request.ServerVariables("REMOTE_ADDR") & "', " & request("country") & ", '" & request("password") & "', '" & request("dob_day") & "/" & request("dob_month") & "/" & request("dob_year") & "', " & request("usr_gender") & ", '" & request("url") & "', '" & request("desc") & "', '" & request("usr_twn") & "', '" & request("usr_post_code") & "'", connStr, , , adCmdTableDirect
rs.close

End Function


Any help would be greatfully recieved.

nikkiH
03-30-2006, 07:36 PM
Not positive, but the ASP code I'm stuck maintaining doesn't use the open method of a recordset to execute a stored procedure.
It makes the SQL, complete with exec call, as a string, then calls connection execute method.

i.e. like this (modified for posting in a public forum)

Set ObjRS = server.CreateObject("ADODB.RecordSet")
strSQL = "SP_NAME '" & CDate(strSDate) & ... etc
set ObjRS = objConn.Execute(strSQL)

where objConn is an already open connection.

Note that we use SQL Server, not Access, so could be a DBMS-specific thing.

phill_ridout
03-31-2006, 08:52 AM
one other thing i had noticed, was that although i got that error, the data was still being inserted in to the table.

phill_ridout
04-01-2006, 09:14 PM
but i dont know how to creat an open connection. any help would be good!:thumbsup:

nikkiH
04-03-2006, 01:51 PM
Simple example here:
http://www.ipwebdesign.net/useful_aspquery.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum