Choklander
asked on
MS Access SELECT INTO
I have two databases. Lets call the first DB1 and the second DB2.
I am connecting to those databases in MFC.
I am trying to copy one table from DB2 to DB1. Lets call it Table1. Lets call the new table Table2.
I use ExecuteSQL() function of CDatabase calling it from the first Database object.
m_db1.ExecuteSQL(_T(SELECT * INTO Table2 FROM Table1 IN 'Data\\DB2.mdb'));
Well everything is working perfectly. But I am going to put passwords on those two databases. My question is: How do I provide the passwords in the SQLString?
I am connecting to those databases in MFC.
I am trying to copy one table from DB2 to DB1. Lets call it Table1. Lets call the new table Table2.
I use ExecuteSQL() function of CDatabase calling it from the first Database object.
m_db1.ExecuteSQL(_T(SELECT
Well everything is working perfectly. But I am going to put passwords on those two databases. My question is: How do I provide the passwords in the SQLString?
ASKER
Well how do I provide their passwords ? I open db1 and from it's object I call the ExeciteSQL. But in that SQLString I need to provide the password for db2. How do I provide it? Can you show me on the SQLString I have provided you with?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> I need to provide the password for db2. How do I provide it?
By opening a connection til db2 too including the password.
I know nothing about MFC so I cannot provide code but this method is generic.
/gustav
By opening a connection til db2 too including the password.
I know nothing about MFC so I cannot provide code but this method is generic.
/gustav
Hello Cactus ...
The posters question indicates that the desire is to have the pwd (assuming its a database password) in the SQL statement ...
>> How do I provide the passwords in the SQLString? <<
The posters question indicates that the desire is to have the pwd (assuming its a database password) in the SQL statement ...
>> How do I provide the passwords in the SQLString? <<
ASKER
Thanks a lot. The problem with my string was that I put my database source in the '' single quotes. Nice explanation top grade. Have fun.
You're most welcome! ...
/gustav