472,961 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Urgent Please help..

Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks

Jul 4 '06 #1
17 2225
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #2
Why does urgent have to piss someone cuz im really in need of help
here. anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.

Evertjan. wrote:
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #3

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?

Jul 4 '06 #4
Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Evertjan. wrote:
>Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i
need a way to call these from my asp page so the user can run them
from the browser. Meaning i have a page with a list of all scripts.
each when clicked i am able to run the script. so HOW and what do i
do to call and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
[please do not toppost on usenet, the same pisses off applies]
Why does urgent have to piss someone
It does not have to, off.
It is just the way it is.
People will answer in their own good time.
cuz im really in need of help here.
Evenso. This applies to most OQ's here.
A meaningful subjectfield text would help more. [field changed]
anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.
Whose "need"?

It seems native classic ASP does not support it, based on the minute
info you give about the content of such files.

So another executing engine needs to be introduced,
and perhaps the type of database it is intended to run on.

Can you give info about that, Saps?
What DB and what DB-engine are you running?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #5
Anthony Jones wrote on 04 jul 2006 in
microsoft.public.inetserver.asp.general:
Are you familiar with ADO?
I met him in the theatre the other day.

Much ADO about nothing, he said.

It was like Jmail talking about the do's and don'ts of CDO and CDONT.

;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 4 '06 #6
The SQL file contains multiple select statements created using notepad,
that would obviously return some information. Yes I am familiar with
ADO. Currently if there are 3 sets of SQL statements, they are nt
separated by any GO. Altho i can impose them a format if required to
run from ASP.
Where i work, we have a set of users who develop these clean up
scripts(sql select statements) and upload them in a particular folder.
The target users who access this site are meant to execute these SQL
statements so they get the rows of data that the script returns. I know
its much simpler if the creators just give me the statements and i use
them ASP but its a matter of making it dynamic, they create and upload,
the users sees it and runs it.
thx for bearing with me and help will greatly b appreciated.
Anthony Jones wrote:
"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks

What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?
Jul 4 '06 #7
CJM

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
There is no native way that I know of, but I don't see why you can't just
read the T-SQL from the files and execute it via ADO.

It sounds a bit messy to me though, and we have no context in which to
answer. What do the scripts do? Who creates them? Who uses the application
(security may be an issue). What kind of SQL is being used?

More importantly, what are you trying to achieve? Why do you want users to
be about to run SQL scripts from ASP?

CJM
Jul 4 '06 #8
Saps wrote:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
Sapa,

I've never used something like that, but considering that the sql
command in ASP is an ordinary string, I believe taht you may do what
you wnat by FSO.
Try to read the sql file and put its contents on a string and them
execute the command object.

Jul 4 '06 #9
"Evertjan." wrote ...
>Are you familiar with ADO?

I met him in the theatre the other day.

Much ADO about nothing, he said.

It was like Jmail talking about the do's and don'ts of CDO and CDONT.

;-)
For one so keen on the "rules" your post was kind OT wasn't it ;o)

And yes, I do appreciate the irony of my reply, and most likely
yours.....here we go! :o)

Regards

Rob
Jul 4 '06 #10
Saps wrote:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
You would probably be better off if you encapsulated the T-SQL in those
script files into stored procedures which can easily be executed from an ASP
file via ADO.

CREATE PROCEDURE RunMySQL1 AS
<copy and paste your sql script file contents here>

Run the above script on your server, grant the appropriate permissions to
the users that need to run it, and, in your ASP page:

dim cn, proc
proc = request.form("selectedscript")
set cn=createobject("adodb.connection")
cn.open <your connection string>
'http://www.aspfaq.com/show.asp?id=2126
select case proc
case "1": cn.RunMySQL1
...
case else:
end select
cn.close: set cn=nothing

What is your perceived advantage in using script files instead of stored
procedures?

If you are stuck with script files, you have several options:
1. As stated by MFedatto, you can use FSO to read the sql from the file
(http://www.aspfaq.com/show.asp?id=2039) and execute it using an ADO
connection object. With this approach, you need to take care to strip out
non-T-SQL words like "GO"

2. Depending on your version of SQL Server, you can install either isql or
osql (look them up in SQL Books Online ... BOL) on your web server and use
wscript.shell to run the script files using the appropriate tool for your
sql server.

3. Again, depending on your version of SQL Server, install either SQL-DMO or
SMO (if using SQL 2005) and use them to run your script files (look them up
in BOL)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 4 '06 #11

"Saps" <sa***********@yahoo.comwrote in message
news:11*********************@v61g2000cwv.googlegro ups.com...
The SQL file contains multiple select statements created using notepad,
that would obviously return some information. Yes I am familiar with
ADO. Currently if there are 3 sets of SQL statements, they are nt
separated by any GO. Altho i can impose them a format if required to
run from ASP.
Not having GO is a good thing.

As others have pointed out you could simply load the text of the file via
Scripting.FileSystemObject and execute the script via ADO.

You would have to impose that GO is not used since it's used to delimit
batches to be executed which is a facility not offered by ADO.
Where i work, we have a set of users who develop these clean up
scripts(sql select statements) and upload them in a particular folder.
The target users who access this site are meant to execute these SQL
statements so they get the rows of data that the script returns. I know
its much simpler if the creators just give me the statements and i use
them ASP but its a matter of making it dynamic, they create and upload,
the users sees it and runs it.
thx for bearing with me and help will greatly b appreciated.
Anthony Jones wrote:
"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql
Thanks
>
What do the SQL files contain? SQL Server T-SQL?
Do they contain multiple batches? (I.e. do they use the GO key word)
Are you familiar with ADO?

Jul 4 '06 #12
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a subject like
that.

"Saps" <sa***********@yahoo.comwrote in message
news:11**********************@a14g2000cwb.googlegr oups.com...
Why does urgent have to piss someone cuz im really in need of help
here. anyways a .sql file is a sql script file which needs to be run
from a classic ASP page.

Evertjan. wrote:
>Saps wrote on 04 jul 2006 in microsoft.public.inetserver.asp.general:
Hi all. Can anyone help me here. I have loads of .sql files and i need
a way to call these from my asp page so the user can run them from the
browser. Meaning i have a page with a list of all scripts. each when
clicked i am able to run the script. so HOW and what do i do to call
and run the .sql

"Urgent" only pisses off the helpful people in this NG.

What is an .sql file?
It seems not part of classic ASP, the NG's subject.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Jul 4 '06 #13
Kyle Peterson wrote:
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.

You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received ...
;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 4 '06 #14
I never saw that anywhere.
original thread (subject: "Execute .sql scripts from ASP")

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Kyle Peterson wrote:
>I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received
... ;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 5 '06 #15
but I just found it
"Kyle Peterson" <ky*****@hotmail.comwrote in message
news:eZ**************@TK2MSFTNGP03.phx.gbl...
>I never saw that anywhere.
original thread (subject: "Execute .sql scripts from ASP")

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcomwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>Kyle Peterson wrote:
>>I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received
... ;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 5 '06 #16
Yes Bob. i had posted this question when i was in most need of help.
and when i open to chk if anyone replied..NOONE did. i had to put it
this way for people to atleast open it and chk if they can help. but
anyways i have really appreciated the help i gt. yes like u guys
mentioned, i can read each line of the script store it in a string and
execute it. im going to have to try doing that. Can i get a sample code
of how to do that tho. Please.
And hey guys sorry for all the botherations u'll had answering this
thread but it has helped me ALOT. thx.

Bob Barrows [MVP] wrote:
Kyle Peterson wrote:
I think the more relevent issue is that your Subject should mention
something about the question your asking.
This helps keep the newgroup posts clean and easier to look through.

"Urgent Please help.."

Is an annoying and useless Subject title. At least to me it is.

Your also going to get a lot less people reading a post with a
subject like that.


You know, I would typically agree with that statement, but ...
compare the number of responses in this thread to the number of responses
the original thread (subject: "Execute .sql scripts from ASP") received ...
;-)

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 5 '06 #17
Saps wrote:
Yes Bob. i had posted this question when i was in most need of help.
and when i open to chk if anyone replied..NOONE did. i had to put it
this way
No, you didn't. You could (should) have replied to the original post.
for people to atleast open it and chk if they can help.
but
anyways i have really appreciated the help i gt. yes like u guys
mentioned, i can read each line of the script store it in a string and
execute it. im going to have to try doing that.
Why do you have to use .sql files? You have yet to answer this question.
SQL files are not really a good mechanism for implementing application
logic. They are really meant for maintenance tasks that are infrequently
performed.
Can i get a sample
code of how to do that tho. Please.
Unless someone has a lot of time on his hands (or is intrigued by the
problem), nobody is going to write it for you. Look at the link I
provided (http://www.aspfaq.com/show.asp?id=2039), do some reading in
the other articles on that site, and try doing it yourself. If you get
stuck, come back and show us where you are stuck.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 5 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: js | last post by:
Hi all, I currently encounter a problem and it is urgent to me. After calling the MsgBox.Show(), the message box is shown with non-modal mode, what is the possible reason??? This only happen...
3
by: Liu Ju | last post by:
Dear members: I want to use the multithread in my program which is developed in Visual C++ platform (version 6). I created a controlling function: UINT CCOMM1Dlg::WritingThreadFunc(LPVOID...
2
by: learner | last post by:
Hi, In a page, i have many links. I have some functions in a global file which is included in all linked pages. I want to have a reference to a window which is to be opened on clicking one link...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dimitri | last post by:
PLEASE HELP,I HAVE A DATABSE WITH MULTIPLE RECORDS AS OUTLINED BELOW EMP NO LEVEL NEXTINCREASE WAGETYPE UNIT 1000 1 0 1000 1000 1 0 1002 ...
0
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
4
by: ashasivan | last post by:
Hi, Please help me as soon as possible for the following problem. It is very very urgent. I have an XML file as follows: <?xml version="1.0" standalone="yes"?> <Employee> <em...
1
by: psantosh12 | last post by:
Hello Frnds Please need help to resolve error.......... it is very very urgent........ The error is Runtime Error Description: An application error occurred on the server. The current custom...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.