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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open a password-protected table?

Status
Not open for further replies.

hichuji

Programmer
Jun 4, 2002
13
SG
hi, I want to create ADO recordset of a Paradox file, but then the file is password-protected. how can I modify the code so that can open? (the codes work fine with non-password-protected paradox file).Thanks...

Dim dbConn, rsConn, strSQL

Set dbConn = CreateObject("ADODB.connection")
dbConn.Open ("dsn=testing")
strSQL = "select * from Test1"
Set rsConn = dbConn.Execute(strSQL)
 
See this URL:

Look for the heading:
Share-level (password-protected) databases

From the page:
ADO

Sub ADOOpenDBPasswordDatabase()
Dim cnn As New ADODB.Connection
cnn.Open "Provider=" & _
"Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.\NorthWind.mdb;" & _
"Jet OLEDB:Database Password=" & _
"password;"
cnn.Close

The connection string I used that finally worked:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\myProgs\\MyData;Jet OLEDB:Database Password=FOO;Extended Properties=Paradox 5.x;"

Hope this helps.

Tim
 
thanks Tim, but my situation is:eek:nly the paradox file is password-protected, not the database. Btw, do u know how to change password for a paradox file if the file is in read only mode?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top