|
-
May 17th, 2001, 03:18 PM
#1
simple piece of code - need help
hi,
this is the code
var UID = objConn.execute("select UID from Tbl_users where EmailName='"+strEmailAddr+"'");
Response.write(UID);
it gives an error at the Response.write line, saying:
Response object error 'ASP 0185 : 8002000e'
Missing Default Property
A default property was not found for the object.
UID is an auto-number in my sql database, and strEmailAddr is a varchar.
I've tested the sql with query analyzer and it works fine (ie there is a UID value for the particular email address I check), but it doesn't work from my asp page.
Any ideas?
-
May 17th, 2001, 05:17 PM
#2
Re: simple piece of code - need help
If think this will not work cause you trying to set a var with a recordset... Try to declare UID as and ADODB.Recordset and use
UID.open "sql command"
and then use
response.write(UID("datafield"))
That's it..
-
May 18th, 2001, 05:53 AM
#3
Re: simple piece of code - need help
tried this:
var RS = Server.CreateObject("ADODB.Recordset");
RS.Open("select * from Tbl_users where EmailName='"+strEmailAddr+"'");
Response.write(RS("UID"));
It didn't work - gave the following error:
ADODB.Recordset error '800a0e7d'
The application requested an operation on an object with a reference to a closed or invalid Connection object.
what am I doing wrong?
-
May 18th, 2001, 10:13 AM
#4
Re: simple piece of code - need help
I didn't tested it but, the right way is...
Dim rs, conn
set conn = Server.CreateObject("ADODB.Connection")
set rs = Server.CreateObject("ADODB.Recordset")
'Change it to your connection string
conn.open "Driver=Microsoft Access Driver (*.mdb);DBQ=your_bd_here.mdb"
rs.open "select * (......)", conn
response.write(rs("UID"))
I think it will work... You only must pay attention to the connection string you'll use.
-
May 18th, 2001, 10:27 AM
#5
Re: simple piece of code - need help
what's the javascript equivalent of:
set RS = .........
I've been looking, but I all the examples I can find are in vbscript!
also, I have my conn.open done already above the piece of code I gave - I don't need to do it again do I?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|