Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ODBC Connection Error


Message #1 by "Mohamad Zaamzamir A.Jalil" <zamirjalil@y...> on Tue, 20 Mar 2001 01:31:16
Hello,



Pls help me. I'm using ODBC to connet my db in Access 2000. I created this 

connection in an inlude file named "mydbconn.asp". Then I 

include "mydbconn" in another file named "verify_user.asp" where I created 

a recordset to verify a user id and password here.



Below is the code:

mydbconn.asp -



1<%	Response.Buffer=True

2

3	Set MyDb = server.createobject("ADODB.Connection")

4	MyDB.open "DSN=eJurnal"

5	

6	''--Ms Access2000 Connection

7	'set conn = server.createobject("adodb.connection")

8	'conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; 

DBQ=d:/temp/data/Copysmub.mdb"



%>





verify_user.asp-



1<%Response.Buffer=true%>

2<!--#INCLUDE File="mydbconn.asp"-->

3<HTML><HEAD>

4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

5</HEAD>

6<BODY>

7

8<%

9Dim rs,strsql

10

11set rs = server.CreateObject("ADODB.Recordset")

12

13strsql = "Select userid, password From tblAkademia Where userid ='"& _

14Request.Form("userid") &"' AND password ='"& Request.Form("password") 

&"'"

15......

16......



Error Displayed:



Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database 

engine cannot open the file '(unknown)'. It is already opened exclusively 

by another user, or you need permission to view its data.

/tugasan/include/mydbconn.asp, line 4



Hope somebody can help me.



TQ



Message #2 by "Tomm Matthis" <matthis@b...> on Tue, 20 Mar 2001 08:12:19 -0500
Try using OLEDB instead... less error-prone, and much faster IMO.



Tomm



> -----Original Message-----

> From: Mohamad Zaamzamir A.Jalil [mailto:zamirjalil@y...]

> Sent: Tuesday, March 20, 2001 1:31 AM

> To: ASP Databases

> Subject: [asp_databases] ODBC Connection Error

>

>

> Hello,

>

> Pls help me. I'm using ODBC to connet my db in Access 2000. I

> created this

> connection in an inlude file named "mydbconn.asp". Then I

> include "mydbconn" in another file named "verify_user.asp" where

> I created

> a recordset to verify a user id and password here.

>

> Below is the code:

> mydbconn.asp -

>

> 1<%	Response.Buffer=3DTrue

> 2

> 3	Set MyDb =3D server.createobject("ADODB.Connection")

> 4	MyDB.open "DSN=3DeJurnal"

> 5=09

> 6	''--Ms Access2000 Connection

> 7	'set conn =3D server.createobject("adodb.connection")

> 8	'conn.open "DRIVER=3D{Microsoft Access Driver (*.mdb)};

> DBQ=3Dd:/temp/data/Copysmub.mdb"

>

> %>

>

>

> verify_user.asp-

>

> 1<%Response.Buffer=3Dtrue%>

> 2<!--#INCLUDE File=3D"mydbconn.asp"-->

> 3<HTML><HEAD>

> 4<meta http-equiv=3D"Content-Type" content=3D"text/html; 

charset=3Diso-8859-1">

> 5</HEAD>

> 6<BODY>

> 7

> 8<%

> 9Dim rs,strsql

> 10

> 11set rs =3D server.CreateObject("ADODB.Recordset")

> 12

> 13strsql =3D "Select userid, password From tblAkademia Where userid 

=3D'"& _

> 14Request.Form("userid") &"' AND password =3D'"& 

Request.Form("password")

> &"'"

> 15......

> 16......

>

> Error Displayed:

>

> Error Type:

> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)

> [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database

> engine cannot open the file '(unknown)'. It is already opened 

exclusively

> by another user, or you need permission to view its data.

> /tugasan/include/mydbconn.asp, line 4

>

> Hope somebody can help me.


  Return to Index