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