Hi,
I would like to import a Dbase file into my access database using the api browser. I have all of the code and the dialog opens and I can select my file. The problem is when I try a domcd transferdatabase, I can't seem to get it right. The error is:
run time error 3044
'C:\data\paradise.DBF' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Function:
Function TestIt()
Dim strFilter As String
Dim strInputFileName As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)", "*.XLS")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strInputFileName = ahtCommonFileOpenSave( _
filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
Debug.Print Hex(lngFlags)
Debug.Print strInputFileName
DoCmd.TransferDatabase acImport, "DBase III", strInputFileName, acTable, False
End Function
Thanks in advance.....
Ken
I would like to import a Dbase file into my access database using the api browser. I have all of the code and the dialog opens and I can select my file. The problem is when I try a domcd transferdatabase, I can't seem to get it right. The error is:
run time error 3044
'C:\data\paradise.DBF' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Function:
Function TestIt()
Dim strFilter As String
Dim strInputFileName As String
Dim lngFlags As Long
strFilter = ahtAddFilterItem(strFilter, "dBASE Files (*.dbf)", "*.DBF")
strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.xls)", "*.XLS")
strFilter = ahtAddFilterItem(strFilter, "Text Files (*.txt)", "*.TXT")
strInputFileName = ahtCommonFileOpenSave( _
filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
' Since you passed in a variable for lngFlags,
' the function places the output flags value in the variable.
Debug.Print Hex(lngFlags)
Debug.Print strInputFileName
DoCmd.TransferDatabase acImport, "DBase III", strInputFileName, acTable, False
End Function
Thanks in advance.....
Ken