![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Everyone, I am seeming to have issue with some code I used years ago and now doesnt seem to want to work. I have only a guess as to why - data type issues with the Excel ISAM driver. I was wondering if anyone might find five minutes to give this a try and let me know if it works for them? Private Sub test() Dim dbEng As DAO.DBEngine Dim dbCon As DAO.Database Dim dbSQL As String Set dbEng = New DAO.DBEngine dbEng.CreateDatabase "C:\TryThis.mdb", ";LANGID=0x0409;CP=1252;COUNTRY=0", 64 Set dbCon = dbEng.OpenDatabase(ThisWorkbook.FullName, False, True, "Excel 8.0;") dbCon.Execute "SELECT * INTO [C:\TryThis.mdb].[Test] FROM [Sheet1$];" dbCon.Close If Not dbEng Is Nothing Then Set dbEng = Nothing If Not dbCon Is Nothing Then Set dbCon = Nothing End Sub I was running this is Excel 2003 to (in theory) Access 2003. The goal is to give some of my colleagues in my department the ability to 'push' data into an Access MDB file instead of having to re-acquire it from a third party online data source which is painfully slow to work with. ie/ They can just re-connect to the local mdb file instead. The code above works fine up until the dbCon.Execute line, where I am getting an error: Run-time error '3274': External table is not in the expected format. I could have sworn that I used this successfully with A'97 and E'97. Anyway, I have posted this in an Access newsgroup as I am hoping that there is more in-depth knowledge of what the possible issue(s) might be and possible solutions since I know just how smart and experienced some of you are. Oh yeah, the code is being executed from Excel 2003. I always thought that the 'SELECT * INTO.........' syntax would create the target table as required, or maybe thats only purely inside Access. Any help appreciated. Cheers The Frog Sample Data in Excel: COL_A * * COL_B * * COL_C try1 * * * * *try4 * * * * *try7 try2 * * * * *try5 * * * * *try8 try3 * * * * *try6 * * * * *try9 I placed all of this in Sheet1 starting with COL_A in position A1 and finishing with try9 in C4. |
#3
| |||
| |||
|
|
I am seeming to have issue with some code I used years ago and now doesnt seem to want to work. I have only a guess as to why - data type issues with the Excel ISAM driver. I was wondering if anyone might find five minutes to give this a try and let me know if it works for them? Private Sub test() Dim dbEng As DAO.DBEngine Dim dbCon As DAO.Database Dim dbSQL As String Set dbEng = New DAO.DBEngine dbEng.CreateDatabase "C:\TryThis.mdb", ";LANGID=0x0409;CP=1252;COUNTRY=0", 64 Set dbCon = dbEng.OpenDatabase(ThisWorkbook.FullName, False, True, "Excel 8.0;") dbCon.Execute "SELECT * INTO [C:\TryThis.mdb].[Test] FROM [Sheet1$];" dbCon.Close If Not dbEng Is Nothing Then Set dbEng = Nothing If Not dbCon Is Nothing Then Set dbCon = Nothing End Sub I was running this is Excel 2003 to (in theory) Access 2003. The goal is to give some of my colleagues in my department the ability to 'push' data into an Access MDB file instead of having to re-acquire it from a third party online data source which is painfully slow to work with. ie/ They can just re-connect to the local mdb file instead. The code above works fine up until the dbCon.Execute line, where I am getting an error: Run-time error '3274': External table is not in the expected format. I could have sworn that I used this successfully with A'97 and E'97. Anyway, I have posted this in an Access newsgroup as I am hoping that there is more in-depth knowledge of what the possible issue(s) might be and possible solutions since I know just how smart and experienced some of you are. Oh yeah, the code is being executed from Excel 2003. I always thought that the 'SELECT * INTO.........' syntax would create the target table as required, or maybe thats only purely inside Access. Any help appreciated. Cheers The Frog Sample Data in Excel: COL_A COL_B COL_C try1 try4 try7 try2 try5 try8 try3 try6 try9 I placed all of this in Sheet1 starting with COL_A in position A1 and finishing with try9 in C4. |
#4
| |||
| |||
|
#5
| |||
| |||
|
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |