View Full Version : Problems with sql (easy)
photoman
07-01-2003, 04:30 PM
I am getting the following error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
ODBC driver does not support the requested properties.
/shkalim2/site/login.asp, line 102
On this particular piece of code:
Dim Conn4
Dim RS4
Set Conn4 = Server.CreateObject("ADODB.Connection")
Conn4.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\shkalim2\db\Copy of Users.mdb")
Set RS4 = Server.CreateObject("ADODB.Recordset")
RS4.Open "SELECT * FROM Users " & _
"WHERE Users.Username ='" & Session("Username2") & _
"' AND Users.Id_num ='" & Session("uid") & "'" , Conn4,1,1
Line 102 is:
RS4.Open "SELECT * FROM Users " & _
arnyinc
07-01-2003, 05:26 PM
It probably has something to do with the magic numbers at the end of your RS4.open command. What are the two 1's for and do they correspond to the connection and actions you are making?
photoman
07-01-2003, 05:31 PM
Originally posted by arnyinc
It probably has something to do with the magic numbers at the end of your RS4.open command. What are the two 1's for and do they correspond to the connection and actions you are making?
without the 2 1's I get the following error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e07'
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
/shkalim2/site/login.asp, line 102
Shouldn't it be
RS4.Open "SELECT * FROM Users " _
& "WHERE Users.Username ='" & Session("Username2") _
& "' AND Users.Id_num ='" & Session("uid") & "'" , Conn4,1,1
The 1,1 are the cursortype (adOpenKeyset) and locktype (adLockReadOnly)
photoman
07-01-2003, 05:58 PM
Originally posted by raf
Shouldn't it be
RS4.Open "SELECT * FROM Users " _
& "WHERE Users.Username ='" & Session("Username2") _
& "' AND Users.Id_num ='" & Session("uid") & "'" , Conn4,1,1
The 1,1 are the cursortype (adOpenKeyset) and locktype (adLockReadOnly)
Still not working
If you want to see all the code and see if that helps at all it is located at
http://www33.brinkster.com/shkalim/help/login.asp
Stil not working ... that doesn't say much. Maybe first try it like
dim strSQL
strSQL = "SELECT * FROM Users WHERE Users.Username ='" & Session("Username2") & "' AND Users.Id_num ='" & Session("uid") & "'"
RS4.Open strSQL, Conn4
anf if that doesn't work, use
dim strSQL
strSQL = "SELECT * FROM Users WHERE Users.Username ='" & Session("Username2") & "' AND Users.Id_num ='" & Session("uid") & "'"
response.write strSQL
response.end
(place this code before the RS4.Open strSQL, Conn4 so that you can see which sql-statement is actually executed --> to check if the syntax and sessionvalues are correct)
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.