0.) Write your SQL Script, and save to disk.
1.) Create the aspx page.
2.) Create an ADO connection in the aspx page.
3.) Open the ADO connection.
4.) Load the SQL Script from disk using FSO & TextStream.
5.) Run the script using the ADO connection's Execute method.
6.) Close connection
7.) End Script
8.) Lather, rinse, repeat
great. good idea. But how do I exactly use the textstream object to read
line by line and execute.
Do I need to put a for loop or something? Please advice.
yes I am using CommandText only .. the problem is I am reading from a .SQL
file and hence I need to execute multiple lines. Using FSO i am storing the
string in a variable - however the string concatinates the whole SQL script
and code doesn't seem to work.
yes I am using CommandText only .. the problem is I am reading from a .SQL
file and hence I need to execute multiple lines. Using FSO i am storing the
string in a variable - however the string concatinates the whole SQL script
and code doesn't seem to work.
Have you tried debugging what you're pulling in from the file, before you
execute it?
Also, are you reading the file one line at a time, or the whole lot? If it's
one line at a time, you will need to add in spaces after each line,
otherwise you'll get syntax problems.
try to split the script on each vbCrLf & "GO". execute each split part
separately.
HTH,
</wqw>
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.