Thanks!
Bob,
Use a "SELECT INTO" sql command as follows:
'*********
Dim oConn As ADODB.Connection
Dim sSQL As String
' Create and open a new connection to local backup MDB
Set oConn = New ADODB.Connection
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.\Backup.mdb;"
' Select all records from Products table in Northwind SQL Server DB
' and place them into a Products_Backup in local backup MDB
sSQL = "SELECT * INTO Products_Backup FROM "
sSQL = sSQL & "[odbc;Driver={SQL Server};Server=(local);"
sSQL = sSQL & "Database=northwind;Uid=myUsername;Pwd=myPassword;].Products"
oConn.Execute sSQL, , adExecuteNoRecords
'*********
--
Thanks,
Carl Prothman
Microsoft Visual Basic MVP
http://www.able-consulting.com
In SQL Server Enterprise Manager, select the database you want to backup,
click Tools | Data Transfirmation Services | Export Data, you will see a
Wizard that can be used to export data to kinds of destinations including
Access database. You can have a look at this wizard and will understand how
many tasks you will have to consider if you want to programmatically
implement the same function.
You may want to consider contact a Microsoft Certified Solution Provider
for help on this issue. For detailed information about Microsoft Certified
Solution Providers, please see the following page on the World Wide Web:
http://mcspreferral.microsoft.com/
err.number = -2147217865
err.Description = Cannot find table or constraint.
If I shutdown the app and restart, the CREATE will work.
I have most of the code written including creating the tables and INSERT
statements (which I dynamically build using the syscolumns table). I'm just
afraid all the process will make it extremely slow. I was hoping for
something like Carl suggested but wasn't aware you could run the SELECT INTO
across databases. I'm going to try that out and see if I have any luck with
it.
Thanks!
"chris" <chri...@microsoft.com> wrote in message
news:se1spUj...@cppssbbsa01.microsoft.com...
Thanks!
Bob
"Carl Prothman" <car...@spamcop.net> wrote in message
news:uvWFFadJBHA.860@tkmsftngp02...
That's exactly what I was looking for.
Thanks!
Bob
"Carl Prothman" <car...@spamcop.net> wrote in message
news:uvWFFadJBHA.860@tkmsftngp02...
"[odbc;Driver={SQL Server};Server=(local);"
Thanks again.
Bob
"Carl Prothman" <car...@spamcop.net> wrote in message
news:uvWFFadJBHA.860@tkmsftngp02...
Bob,
Yes try the following connection string:
sSQL = sSQL & "[odbc;DSN=northwind;UID=myUsername;PWD=myPassword;].Products"
For other connection string examples, see:
http://www.able-consulting.com/ADO_Conn.htm
"Carl Prothman" <car...@spamcop.net> wrote in message
news:OxmJBenJBHA.1096@tkmsftngp04...
sSQL = "SELECT * INTO BackupTable FROM "
sSQL = sSQL & "[odbc;DSN=DBToBackup;]"
sSQL = sSQL & ".TableToBackup"