plz help!! Access into MS Access Database

Hi all!
I'm now trying to establish a connection into Access.
Here is my code first.

dim strUser, strPassword, strSQL
dim found
dim objrsUsers
dim objConn

found=0
strUser = Request.form("txtUser")
strPassword = Request.form("txtPassword")

set objConn = Server.CreateObject("ADODB.Connection")
set objrsUsers = Server.CreateObject("ADODB.Recordset")
strSQL = "select * from tblUser where UID='" &strUser& "'" & " AND PWD='" &strPassword&"'"

'objConn.Open "DSN=Logon"
objConn.Open strConnect
objrsUsers.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText

and I got this error msg:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/abcomm/ConfirmLogin.asp, line 20

Basically what I'm trying to do is creat a login page of a website that using MS Access as database. I think connection is already established but somehow it says argument are wrong and I tried every argument like adOpenKeySet..or adLockPessimistic... but nothing's worked.

I tried both DSN-less and DSN way.
I'm using Win2000 pro NTFS formatted.

It worked before but it's not working anymore.
any suggesting plz?

thanks in advance
Chris

Comments

  • : Hi all!
    : I'm now trying to establish a connection into Access.
    : Here is my code first.
    :
    : dim strUser, strPassword, strSQL
    : dim found
    : dim objrsUsers
    : dim objConn
    :
    : found=0
    : strUser = Request.form("txtUser")
    : strPassword = Request.form("txtPassword")
    :
    : set objConn = Server.CreateObject("ADODB.Connection")
    : set objrsUsers = Server.CreateObject("ADODB.Recordset")
    : strSQL = "select * from tblUser where UID='" &strUser& "'" & " AND PWD='" &strPassword&"'"
    :
    : 'objConn.Open "DSN=Logon"
    objConn.Open [red]strConnect[/red]

    [blue]What's strConnect ? You haven't declared,defined it[/blue]


    : objrsUsers.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
    :
    : and I got this error msg:
    : ADODB.Recordset (0x800A0BB9)
    : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    : /abcomm/ConfirmLogin.asp, line 20
    :
    : Basically what I'm trying to do is creat a login page of a website that using MS Access as database. I think connection is already established but somehow it says argument are wrong and I tried every argument like adOpenKeySet..or adLockPessimistic... but nothing's worked.
    :
    : I tried both DSN-less and DSN way.
    : I'm using Win2000 pro NTFS formatted.
    :
    : It worked before but it's not working anymore.
    : any suggesting plz?
    :
    : thanks in advance
    : Chris
    :
    :

  • : : Hi all!
    : : I'm now trying to establish a connection into Access.
    : : Here is my code first.
    : :
    : : dim strUser, strPassword, strSQL
    : : dim found
    : : dim objrsUsers
    : : dim objConn
    : :
    : : found=0
    : : strUser = Request.form("txtUser")
    : : strPassword = Request.form("txtPassword")
    : :
    : : set objConn = Server.CreateObject("ADODB.Connection")
    : : set objrsUsers = Server.CreateObject("ADODB.Recordset")
    : : strSQL = "select * from tblUser where UID='" &strUser& "'" & " AND PWD='" &strPassword&"'"
    : :
    : : 'objConn.Open "DSN=Logon"
    : objConn.Open [red]strConnect[/red]
    :
    : [blue]What's strConnect ? You haven't declared,defined it[/blue]
    :
    :
    : : objrsUsers.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
    : :
    : : and I got this error msg:
    : : ADODB.Recordset (0x800A0BB9)
    : : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    : : /abcomm/ConfirmLogin.asp, line 20

    Thanks for reply Flakes
    But I already defined strConnect in "Logon.inc" file
    Code in Logon.inc is like

    Dim strConnect,filePath
    filePath=Server.MapPath("logon.mdb")
    strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & filePath

    an of course I put in the beginning of this code. With this way I was able to make connection in the other project and in still working in same environment. But this time it's not working.

    Chris
  • : : : Hi all!
    : : : I'm now trying to establish a connection into Access.
    : : : Here is my code first.
    : : :
    : : : dim strUser, strPassword, strSQL
    : : : dim found
    : : : dim objrsUsers
    : : : dim objConn
    : : :
    : : : found=0
    : : : strUser = Request.form("txtUser")
    : : : strPassword = Request.form("txtPassword")
    : : :
    : : : set objConn = Server.CreateObject("ADODB.Connection")
    : : : set objrsUsers = Server.CreateObject("ADODB.Recordset")
    : : : strSQL = "select * from tblUser where UID='" &strUser& "'" & " AND PWD='" &strPassword&"'"
    : : :
    : : : 'objConn.Open "DSN=Logon"
    : : objConn.Open [red]strConnect[/red]
    : :
    : : [blue]What's strConnect ? You haven't declared,defined it[/blue]
    : :
    : :
    : : : objrsUsers.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
    : : :
    : : : and I got this error msg:
    : : : ADODB.Recordset (0x800A0BB9)
    : : : Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
    : : : /abcomm/ConfirmLogin.asp, line 20
    :
    : Thanks for reply Flakes
    : But I already defined strConnect in "Logon.inc" file
    : Code in Logon.inc is like
    :
    : Dim strConnect,filePath
    : filePath=Server.MapPath("logon.mdb")
    : strConnect = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & filePath
    :
    : an of course I put in the beginning of this code. With this way I was able to make connection in the other project and in still working in same environment. But this time it's not working.
    :
    : Chris
    :

    Have you also included the adovbs.inc file ? Otherwise ,can't see what else is wrong.

  • : : Chris
    : :
    :
    : Have you also included the adovbs.inc file ? Otherwise ,can't see what else is wrong.

    Thank you for your help Flakes. Problem has just got fixed. I really appreciate.

    Chris
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories