Write the program code below into the code window.
For intFileSep = Len(opnFileName) To 1 Step -1
If Mid$(opnFileName, intFileSep, 1) = "\" Then Exit For
Next intFileSep
strTempStr = "SELECT * INTO [dBase IV;DATABASE=" + _
Left$(opnFileName, intFileSep - 1) + "].[" + _
Left$(Right$(opnFileName, Len(opnFileName) - intFileSep), _
Len(Right$(opnFileName, Len(opnFileName) - intFileSep)) - _
4) + "]" & " FROM ["& tableName &"]"
DatabaseName.Execute strTempStr
If Mid$(opnFileName, intFileSep, 1) = "\" Then Exit For
Next intFileSep
strTempStr = "SELECT * INTO [dBase IV;DATABASE=" + _
Left$(opnFileName, intFileSep - 1) + "].[" + _
Left$(Right$(opnFileName, Len(opnFileName) - intFileSep), _
Len(Right$(opnFileName, Len(opnFileName) - intFileSep)) - _
4) + "]" & " FROM ["& tableName &"]"
DatabaseName.Execute strTempStr
Add Module in your project, and then type the following program code.
Dim opnFileName As String
Dim strTempStr As String
Dim tableName As String
Dim intFileSep As Integer
Dim DatabaseName As Database
Dim strTempStr As String
Dim tableName As String
Dim intFileSep As Integer
Dim DatabaseName As Database
0 comments:
Posting Komentar