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 export to a password protected database ?

Status
Not open for further replies.

MissyEd

IS-IT--Management
Feb 14, 2000
303
GB
Hi all

I tried to export to a password protected database in MS Access using an Append query. I typed in the name of the database, entered the password when prompted, then selected the table. However, when I tried to run the query I got:

Error 3321 - No database specified in connection string or IN clause.

I checked out the SQL view and had this:
INSERT INTO [;PWD=jigglypuff2000!].RECEIPTS ( CASH_SHEET_DATE, BRANCH_NUMBER, TILL_NUMBER, RECEIPT, STANDARD, ZERO, PRESCRIPTION ) IN 'C:\CASH\VER2\DATABASE\BRANCHDB.MDB'[;PWD=jigglypuff2000!]
SELECT RECEIPTS.CASH_SHEET_DATE, RECEIPTS.BRANCH_NUMBER, RECEIPTS.TILL_NUMBER, RECEIPTS.RECEIPT, RECEIPTS.STANDARD, RECEIPTS.ZERO, RECEIPTS.PRESCRIPTION
FROM RECEIPTS;

I tried changing ;PWD=xxx to MS ACCESS;PWD=xxx but to no avail - help! Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Hi,
Try changin the SQL to:
Code:
INSERT INTO RECEIPTS IN 'C:\CASH\VER2\DATABASE\BRANCHDB.MDB'[;PWD=jigglypuff2000!] ( CASH_SHEET_DATE, BRANCH_NUMBER, TILL_NUMBER, RECEIPT, STANDARD, ZERO, PRESCRIPTION ) SELECT RECEIPTS.CASH_SHEET_DATE, RECEIPTS.BRANCH_NUMBER, RECEIPTS.TILL_NUMBER, RECEIPTS.RECEIPT, RECEIPTS.STANDARD, RECEIPTS.ZERO, RECEIPTS.PRESCRIPTION
FROM RECEIPTS;

as according to acces help the external database name needs to come before the fields to insert into.
Richard
 
Thanks for the help, I'll give it a shot :) Missy Ed
Looking to exchange ideas and tips on VB and MS Access development as well as office 97 development. Drop me a line: msedbbw@hotmail.com
 
Hi Missy,
Before you use that code I've noticed that it changed a [ into [ so you'll need to alter it.
That's strange that's the second piece of code that I've posted that has had &#91 put in instead of something else.
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top