Active Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 1763
Number of posts: 4498

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
plz help!! Access into MS Access Database Posted by remysong on 15 Jan 2004 at 4:40 PM
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

Report
Re: plz help!! Access into MS Access Database Posted by Flakes on 16 Jan 2004 at 7:33 PM
: 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

What's strConnect ? You haven't declared,defined it


: 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
:
:

Report
Re: plz help!! Access into MS Access Database Posted by remysong on 17 Jan 2004 at 3:17 PM
: : 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
:
: What's strConnect ? You haven't declared,defined it
:
:
: : 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 <!--#include file="Logon.inc"--> 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
Report
Re: plz help!! Access into MS Access Database Posted by Flakes on 17 Jan 2004 at 8:17 PM
: : : 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
: :
: : What's strConnect ? You haven't declared,defined it
: :
: :
: : : 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 <!--#include file="Logon.inc"--> 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.

Report
Re: plz help!! Access into MS Access Database Posted by remysong on 18 Jan 2004 at 3:22 AM
: : 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



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.