![]() Scn = "Provider=.4.0 Data Source=" & dbPathĭsh = "" Just for information if anybody seeks for this, I've done a lots of search and found the following code to be work fine for me, and it is real fast due to SQL INSERT, (27648 records in just 3 seconds!!!!): Public Sub DoTrans()ĭbPath = & "\FDData.mdb"ĭbWb = '*********Routine to close connection with databaseĪbove code works fine for few hundred lines of records, but apparently it will be more data to export, Like 25000 records, is it possible to export without looping through all records and just one SQL INSERT statement to bulk insert all data to Ms.Access Table in one go? Public Function CloseConnection() As Boolean Rs.Open TableName, cn, adOpenKeyset, adLockOptimistic Set cn = CreateObject("ADODB.Connection") '*********Routine to establish connection with databaseĭBFullName = & "\FDData.mdb"Ĭs = "Provider=.4.0 Data Source=" & DBFullName & " " Public Function MakeConnection(TableName As String) As Boolean Rs.Fields("fdDate") = Cells(i + 1, 2).Value Rs.Fields("fdName") = Cells(i + 1, 1).Value Public Sub TransData()ĪctiveWorkbook.Worksheets("Folio_Data_original").Activate I am currently using following code to export data from worksheet to MS Access database, the code is looping through each row and insert data to MS Access Table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |