Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OPEN PROTECTED DATABASE USING SQL

Status
Not open for further replies.

pelagic

Programmer
Nov 7, 2002
97
US
Hi there,
SQL code used to work before. After I added the password to REPORT database this code is no longer work. The error message that I am getting is:
Run-time error (-2147467259)
Not a valid password.
I wonder why this happend even though I have provided the correct password for REPORT database.

Any hint will help
thanks,

strPathtoDB2 = App.Path & "\REPORT.mdb;"

cn2.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strPathtoDB2 & _
" Jet OLEDB:Database Password=pwd" 'connection string

cn1.Execute "SELECT * INTO tblREPORT IN " & _
" REPORT.mdb FROM tblDATA"
 
From

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:Database Password=MyDbPassword", _
"myUsername", "myPassword"


======================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top