473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

can u say how to write scripts for MS- Access

Hi All,
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
  1.  
  2.      Option Compare Database
  3.  
  4.   Sub macro1()
  5.        Dim sFileText As String
  6.        Dim strQuery As String
  7.        iFileNo = FreeFile
  8.        Open "c:\sample1.txt" For Input As #iFileNo
  9.        Do While Not EOF(iFileNo)
  10.            Input #iFileNo, sFileText
  11.            strQuery = Replace(sFileText, "99", ",")
  12.           DBEngine(0)(0).Execute strQuery
  13.        Loop
  14.  End sub
  15.  
while reading the data from .txt file, the input method is unable to read the entire line due to the commas (,) so i used 99 instead of ,
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...
Jan 9 '08 #1
2 3465
jaxjagfan
254 Expert 100+
Just a thought...

If both your Access and SQL tables contain the same data

Why not leave it in SQL and link to the table?
Why not use DTS to update the Access database if linking isn't an option?
Jan 9 '08 #2
Hi jaxjagfan,
i want to do few changes only on the Access database. for those few changes i have my own scripts written in Sql server 2000. so i want to run those scripts in Access.
and i don't know about DTS .

can i write and run the scripts in Access ?
if so please let me know how to do?

Thanks in advance....

Just a thought...

If both your Access and SQL tables contain the same data

Why not leave it in SQL and link to the table?
Why not use DTS to update the Access database if linking isn't an option?
Jan 9 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Aardwolf | last post by:
I've had PHP on my Win2K server running IIs 5 for about 2 weeks now. I have an annoying problem in that I can not run the php scripts/pages locally, instead they open up in the browser as a...
13
by: Stumped and Confused | last post by:
Hello, I really, really, need some help here - I've spent hours trying to find a solution. In a nutshell, I'm trying to have a user input a value in form's textfield. The value should then be...
12
by: Radek Maciaszek | last post by:
Hi It's very interesting problem. I couldn't even find any inforamtion about it on the google. I think that the best way of explain will be this simple example: <html> <body> <script...
6
by: comp.lang.php | last post by:
Original thread in http://www.phpbuilder.com/board/showthread.php?p=10659321#post10659321 I have CRON scripts with owner/group relationship of "phillip/apache" that need to access directories...
2
by: AVB | last post by:
Is there any other way to write files to a directory than allowing the IUSR write access. We have a website that will be writing XML files and Label files to a directory outside of our website...
0
by: Sanja Tanasijevic | last post by:
I have serious problem setting read/write privilegues to the folder for customers upload files and photos including possibilities to read them too. Version of IIS is 5.1 and I set up this folder in...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
3
by: eholz1 | last post by:
Hello PHP Group, I am having trouble setting permissions correctly so that the magickwand api (php 5.2) can read and write images. I usually read a file from one directory, create a magickwand...
20
by: _mario.lat | last post by:
hallo, I use PHP and I'd like to not write in hardcoded way password and login to access to mysql. how to not write password in code for access to mysql? How can I do? I'd like that who see my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.