SQL in plain VBS 
Author Message
 SQL in plain VBS

I'm running a plain HTML file with VBS....
I need to run this SQL Query:

"SELECT * FROM " & Request("group") & " WHERE section = '" &
Request("section") & "'"

The Request thing i've written already...
But the problem is... i'm running it under a non-secure server, and the SQL
doesn't wanna run...

is there somehow a way to run it??

Thanx,
Christiano



Fri, 02 Jul 2004 12:49:25 GMT  
 SQL in plain VBS
I don't think you've given enough information for me to be useful.  What
is the connection string that you're using?  Is there anything unusual
about the infrastructure between the non-secure server and the SQL
Server system?  Do you have the appropriate permissions to execute the
statement?  Fill in some of the blanks and I'd be happy to help.

Bruce Johnson
TAG Consulting

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 02 Jul 2004 16:03:27 GMT  
 SQL in plain VBS
This is the code i'm using:

Dim objDBConn, rsDB, strSQL
Set objDBConn = CreateObject("ADODB.Connection")
objDBConn.Provider = "Microsoft.Jet.OLEDB.4.0"
objDBConn.Open "C:\Meus documentos\Chris\programa??o\html\scouts\photo.mdb"

Set rsDB = CreateObject("ADODB.Recordset")

strSQL = "SELECT * FROM " & Request("groups") & " WHERE section = '" &
Request("section") & "'"
rsDB.Open strSQL, objDBConn, 1, 2

i use this code all the time, if i don't give the SQL parameter, it works,
otherwise doesn't....
i don't know if it might work, but, the server which will run the code is
linux, and uses MySQL...
but i don't have access to upload the code to test there...

Bruce Johnson escreveu na mensagem ...

Quote:
>I don't think you've given enough information for me to be useful.  What
>is the connection string that you're using?  Is there anything unusual
>about the infrastructure between the non-secure server and the SQL
>Server system?  Do you have the appropriate permissions to execute the
>statement?  Fill in some of the blanks and I'd be happy to help.

>Bruce Johnson
>TAG Consulting

>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!



Fri, 02 Jul 2004 22:43:08 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Oracle, SQL server, or plain Access?

2. Using Vbscript and SQL-DMO to connect to SQL Server and run a T-SQL script

3. Running SQL through VBS in CMD.

4. SQL and VBS

5. binary data (pictures) from sql-source with asp/vbs/jscr

6. need example of SQL Server connection with .vbs file

7. requesting data from SQL 7.0 with .vbs file

8. running a SQL Server query or stored proc from VBS

9. Passing a date from VBS/ASP to SQL Server

10. VBS Script Delete SQL Record

11. VBS Script delete identical rows in SQL

12. SQL in VBS failing.

 

 
Powered by phpBB® Forum Software