I have the following Connections:
Dim dwnldcn As New ADODB.Connection
With dwnldcn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = CurrentProject.Path & "\Dwld_CPB.mdb"
'.Properties("System Database") = CurrentProject.Path & "\Dwld_CPB.mdb"
.Open
End With
and
'This is for startup initialization - set the connection database
If Len(cnDBName) < 1 Then
Dim strDbName As String
'format the string
strDbName = CurrentProject.Connection 'CurrentDb.TableDefs(1).Connect
strDbName = Right(strDbName, (Len(strDbName)) - InStr(1, strDbName, "Initial Catalog", vbTextCompare) - Len("Initial Catalog"))
strDbName = Left(strDbName, Len(DatabaseNameFormat))
'set the global connection name to the formated string
cnDBName = strDbName
End If
With DBCnn
'.Close 'make sure it's closed before trying to assign and reopen
.Provider = cnProvider
.Properties("Data Source") = cnSrvName
.Properties("Initial Catalog") = cnDBName
.Properties("Integrated Security") = cnSecurity
.Open
End With
DBCnn is the connection to my SQL Server, dwnldcn is the connection to a access 97 DB that houses data that needs to be transfered daily to the server.
Is there an easy and efficient way to transfer this data using these connections?
Right now, to get the data transfered, I've been tranfering the tables to an MDB then using An Append Query to add the data to the tables on the Server.
Going to an ADP I can't use temporary local tables, Can someone please give me a suggestion on how to overcome this issue?
Randall Vollen
National City Bank Corp.
Dim dwnldcn As New ADODB.Connection
With dwnldcn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = CurrentProject.Path & "\Dwld_CPB.mdb"
'.Properties("System Database") = CurrentProject.Path & "\Dwld_CPB.mdb"
.Open
End With
and
'This is for startup initialization - set the connection database
If Len(cnDBName) < 1 Then
Dim strDbName As String
'format the string
strDbName = CurrentProject.Connection 'CurrentDb.TableDefs(1).Connect
strDbName = Right(strDbName, (Len(strDbName)) - InStr(1, strDbName, "Initial Catalog", vbTextCompare) - Len("Initial Catalog"))
strDbName = Left(strDbName, Len(DatabaseNameFormat))
'set the global connection name to the formated string
cnDBName = strDbName
End If
With DBCnn
'.Close 'make sure it's closed before trying to assign and reopen
.Provider = cnProvider
.Properties("Data Source") = cnSrvName
.Properties("Initial Catalog") = cnDBName
.Properties("Integrated Security") = cnSecurity
.Open
End With
DBCnn is the connection to my SQL Server, dwnldcn is the connection to a access 97 DB that houses data that needs to be transfered daily to the server.
Is there an easy and efficient way to transfer this data using these connections?
Right now, to get the data transfered, I've been tranfering the tables to an MDB then using An Append Query to add the data to the tables on the Server.
Going to an ADP I can't use temporary local tables, Can someone please give me a suggestion on how to overcome this issue?
Randall Vollen
National City Bank Corp.