i have some simple scripts( which may have some insert statements, update statements etc). these scripts were written in Sql server 2000. now i want to use the same scripts in Access. (since the data is same in both Access, Sql server databases).
can i write the scripts in Access-2003? if so please help me.
Actually i tried with simple examples. it is working fine for insert, update statements. but it is not working for "If" state ment, and Select statement.
i tried it by using "modules" in the access data base. in module i created macro. in that macro, i am reading the queries from a .txt file with the help of Vb syntax, and am executing that staetement.
i wrote as.....
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Sub macro1()
- Dim sFileText As String
- Dim strQuery As String
- iFileNo = FreeFile
- Open "c:\sample1.txt" For Input As #iFileNo
- Do While Not EOF(iFileNo)
- Input #iFileNo, sFileText
- strQuery = Replace(sFileText, "99", ",")
- DBEngine(0)(0).Execute strQuery
- Loop
- End sub
it is working fine for insert, update statements.
but if i write some if statements, in the .txt file it is giving the error.
Please suggest me any way to write the scripts.
thanks in advance...