Hi,
What's the quickest way of importing text into SQL Server when importing data using Access Project (.adp)?
By the way, I can't use DoCmd.TransferT ext as the files don't have headers.
Current Code:
This code works fine but the text files that will be imported are around 50Mb each. It takes a long time for this code to get through 50Mb!!!!
Regards,
Dark
What's the quickest way of importing text into SQL Server when importing data using Access Project (.adp)?
By the way, I can't use DoCmd.TransferT ext as the files don't have headers.
Current Code:
Code:
Private Sub ImpData_Click() Dim cncurrent As ADODB.Connection Set cncurrent = CurrentProject.Connection Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset 'sql to open table connection Dim strsql As String strsql = "Select * from [T Table]" 'opening the record set rs.Open strsql, cncurrent, adOpenDynamic, adLockOptimistic Dim column(10) As String ' holder for the text data Dim linedata As String Dim i As Integer Open Me.Path For Input As #1 ' open file for input Do Until EOF(1) 'scan through file inputing data to the dataset from the Array Do Until i = 10 Input #1, linedata ' input a line of data from the text file column(i) = linedata i = i + 1 Loop i = 0 rs.AddNew Do Until i = 10 rs.Fields(i) = column(i) i = i + 1 Loop rs.Update i = 0 Loop End Sub
Regards,
Dark
Comment