- Joined
- 5/6/06
- Messages
- 384
- Points
- 28
I am working on setting up a database on Access, since it will involve daily process, I am writing some simple VBA code to do it. I encountered some question when I working on it.
1. When I tried to run the simple code below, I always get an error message "A RunSQL action requires an argument consisting of an SQL statement". Couldn't figure out what kind of argument it means, since I fed the two argumments for RunSQL method already.
2. I have to import txt files daily to the database, unfortunately, the file name looks like "LondonTribecaRSK514.090407", and there's a dot "." among the file name. So the execution of the code fails. When I took away the dot, it works. But I couldn't change the names of the incoming source files.
:sos::sos::sos:
Thank you.
1. When I tried to run the simple code below, I always get an error message "A RunSQL action requires an argument consisting of an SQL statement". Couldn't figure out what kind of argument it means, since I fed the two argumments for RunSQL method already.
Code:
Sub Run_SQL()
Dim SQL_Text As String
SQL_Text = "SELECT Equity_AE.[LongSecurityName], Equity_AE.[LongExposure] " & _
"FROM Equity_AE"
DoCmd.RunSQL SQL_Text, False
End Sub
2. I have to import txt files daily to the database, unfortunately, the file name looks like "LondonTribecaRSK514.090407", and there's a dot "." among the file name. So the execution of the code fails. When I took away the dot, it works. But I couldn't change the names of the incoming source files.
:sos::sos::sos:
Thank you.