|
-
May 26th, 2000, 11:48 AM
#1
Thread Starter
Fanatic Member
Hi hi again Guys...
Now, I'm confuse about opening connection and recordset.
I have a database in Access, named "MyWebDb.Mdb" and the password to open it is "Will"
I'm trying several ways... Here they are :
1st way : From Mark Sreeves
Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\MyWebDB.mdb"))
The question for this is : How should I put the Password ???
2nd way : Using Microsoft Jet OLEDB 4.0
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";Password=Will;"
The question is :
My open statement above doesn't work out.
The error occured is :
Microsoft JET Database Engine error '80040e4d'
Cannot start your application. The workgroup information file is missing or opened exclusively by another user.
/Login.asp, line 19
But, if I eliminate the password at myWebDB.Mdb, and remove the password at Conn.Open statement, like below :
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
My ASP page will start / run.
The question is why ???
And how can I open it, if I want to use password on my Database ???
BRgds,
Wen Lie
[Edited by Wen Lie on 05-27-2000 at 12:49 AM]
-
May 27th, 2000, 06:20 PM
#2
This is where I appear to be a complete boffin! No one saw me looking it up did they?
That puzled me at first too but with a little help from my friends (well t'was "Beginning ASP Databases" from WROX actually...not trying to plug them or anything but I've found it really useful. )
Ok...
Code:
dim oConn
set oConn = Server.CreateObject("ADODB.Connection")
oConn.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};"
oConn.ConnectionString = oConn.ConnectionString & "DBQ=" & Server.MapPath("\MyWebDB.mdb") & ";"
oConn.ConnectionString = oConn.ConnectionString & "PWD=Will"
oConn.Open
How's that sound? Works for me...
You can then use something like:
Code:
Dim oRS
Set oRS = Server.CreateObject("ADODB.Recordset")
oRS.Open TABLENAME/SQL STATEMENT, oConn
-
May 28th, 2000, 10:04 AM
#3
Thread Starter
Fanatic Member
Thx.. But, ...
Thx, but, how about if I want to open it using Microsoft Jet OLEDB 4.0 ???
Wen Lie...
-
May 28th, 2000, 05:37 PM
#4
Erm...Ok,,,let me think :)
I think:
Code:
oConn.ConnectionString = "Provider=Microsoft.Jet.4.00; "
oConn.ConnectionString = oConn.ConnectionString & "Data Source=" & Server.MapPath("\MyWebDB.mdb") & "; "
oConn.ConnectionString = oConn.ConnectionString & "pwd=Will"
Haven't had chance to test that but I think it's about right You may need to use "Password=Will" instead of "pwd=Will".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|