MS-Access RecordSet

A

Al

Can any one explain what wrong with this code?
Same code without the userid and password works fine in the same IIS Server.

Please do not mind the Directive #IF #ELSE #END IF
I only use it to describe you the issue.

#IF PasswordProcted then
'- Works Fine
m_MSConnString =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;"
#ELSE
'- Do not Work
m_MSConnString =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
ID=Admin;Password=123;"
#End IF

Set oRecordSet = Server.CreateObject ("ADODB.Recordset")
oRecordSet.ActiveConnection = m_MSConnString
oRecordSet.Source = "SELECT * FROM TableName"
oRecordSet.CursorType = 0
oRecordSet.CursorLocation = 2
oRecordSet.LockType = 3
oRecordSet.Open()

BTW: User ID and Password are correct I can open the database with MS-Access
when ask for the password insert password and open database with no problem


TIA
Al
 
B

Bob Barrows [MVP]

Al said:
Can any one explain what wrong with this code?
Same code without the userid and password works fine in the same IIS
Server.

What is failing?
'- Do not Work

What does that mean? Error message? We're not looking over your shoulder.
:)
m_MSConnString =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=C:\Database.mdb;User
ID=Admin;Password=123;"

Go to www.able-consulting.com/ado_conn.htm to see an example of the correct
syntax for a connection string to connect to a password-protected database.

Bob Barrows
 
A

Al

Sorry, here it goes

Error Message Gotten
error '8002801d'
Library not registered.

/iisHelp/common/500-100.asp, line 10
 
A

Al

Forgot the error message
on my Windows XP Pro with IIS5
error '8002801d'
Library not registered.

/iisHelp/common/500-100.asp, line 10

on my Windows Host Server

Microsoft JET Database Engine error '80040e4d'

Cannot start your application. The workgroup information file is missing or
opened exclusively by another user.

Try to Open Connection to MS-Access Database
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top