Forums
This topic is locked
Doozie of a DSNless Error
Posted 14 Mar 2002 18:23:15
1
has voted
14 Mar 2002 18:23:15 Myra Prita posted:
Hello, I posted here last week and got some really good advice on the problem, but none of it seemed to fix it (although I thank those who tried to help). Here is the situation. I have an NT Server/IIS 4. I am pulling from an Access database. I am using the following code to pull from the database:
Session.timeout = 15
set conn = server.CreateObject("ADODB.connection"
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data
Source=D:\notfound\notfound.mdb;"
Set rs = Server.CreateObject("ADODB.Recordset"
set rs = conn.Execute("SELECT * FROM wherever WHERE Style = '" &
Request.QueryString("StyleNumber" & "'"
Set lang = Server.CreateObject("ADODB.Recordset"
Set lang = conn.execute("SELECT * FROM TextStrings WHERE Language = '" & TempLang & "'"
When I run this code with a regular ODBC pull it works perfect. When I run it with DSNless, I get the following error:
error '80004005'
Unspecified error
It refers back to where I set lang to equal the SQL string. When I response.write this statement, I receive a Syntax error on the word "Set". This error is not occuring with the rs SQL statement..only with the lang one. Both use querystrings from the previous page to match to information in the Access database. I do not understand why the lang statement is not working as it seems to be correct..any suggestions? I have tried almost everything at this point but can't see the error (I am running the latest VB Script engine on this server by the way). I know this is not server specific as I tried the same code on another NT server. Same problem..it works great with ODBC not with DSNless.
I have tried pratically everything at this point. I even thought that perhaps the table lang pulls from was corrupted so I created a copy of that table, renamed it, and still when I use both SQL strings together I get the Unidentified error. I know this is an OLEDB error as it happans as soon as the connection to the database is made. But should not Jet be able to handle two different SQL strings? Thank you for any help
Replies
Replied 20 Mar 2002 02:41:35
20 Mar 2002 02:41:35 Hank Tan-Tenn replied:
Is "lang" or "language" a reserve word?
Not long ago I switched from ODBC to an ODBC-less connection, and I ran into a syntax problem. (I don't recall the details.) Turned out my Access database used a reserve word that somehow never prevented it from working until the switch.
Check out:
aspfaq.com/show.asp?id=2080 (reserve words)
www.adopenstatic.com/faq/ (troubleshooting)
Edited by - akc on 20 Mar 2002 02:54:27
Not long ago I switched from ODBC to an ODBC-less connection, and I ran into a syntax problem. (I don't recall the details.) Turned out my Access database used a reserve word that somehow never prevented it from working until the switch.
Check out:
aspfaq.com/show.asp?id=2080 (reserve words)
www.adopenstatic.com/faq/ (troubleshooting)
Edited by - akc on 20 Mar 2002 02:54:27