|
-
December 17th, 1999, 11:08 AM
#1
VBScript syntax for ASP/ADO
I need to form a string in VBScript with double quotes in it. How do I do that ?
Ex:
DIM tableSQL
tableSQL = "SELECT * FROM " & Request("tableName")
' tableSQL should come out as
' SELECT * FROM "Order Details"
Truly appreciate your response.
Kailash
-
December 17th, 1999, 11:48 AM
#2
Re: VBScript syntax for ASP/ADO
This should work...
Ex. dim SQ as string
SQ = "Select * " & _
"From OrderDetails"
datRecSel.recordsource = SQ
'Make sure that you place a data control on your form called datRecSel
datRecSel.refresh
'this updates the data source to your query data
If you meant that you wanted to use a table name to select in the query then simply do something like this...
SQ = "Select * " & _
"From '" & txtTableReq.txt & "'"
Please note: this is assuming that the table name comes from a text control named txtTableReq
-
December 17th, 1999, 12:01 PM
#3
Re: VBScript syntax for ASP/ADO
Thanks for your response.
I tried that and the select statement comes out as
SELECT * FROM 'Order Details'
SQL Server treats 'Order Details' as a string and not a table and I get
Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near 'Order Details'.
-
December 17th, 1999, 06:06 PM
#4
Re: VBScript syntax for ASP/ADO
tableSQL = "SELECT * FROM " & chr(34) & Request("tableName") & chr(34)
Charlie Zimmerman
http://www.freevbcode.com
-
December 17th, 1999, 06:19 PM
#5
Re: VBScript syntax for ASP/ADO
Thanks. That worked great !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|