Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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

  • FlakesFlakes Posts: 642Member
    : 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
    :
    :

  • remysongremysong Posts: 4Member
    : : 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
  • FlakesFlakes Posts: 642Member
    : : : 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.

  • remysongremysong Posts: 4Member
    : : 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.