472,353 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

dynamic table name:- [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrec

Expand|Select|Wrap|Line Numbers
  1. Report_Name_Final = "TABLENAME"
  2. DIM mySQL1
  3.  mySQL1 = "SELECT * FROM [TABLENAME]"
  4.  mySQL1 = replace(mySQL1,"[TABLENAME]",Request.Form("Report_Name_Final"))
  5.  
  6. response.write objRS1("Value")
  7.  
trying to get dynamic table name
i getting this error

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'FROM'.
May 26 '10 #1

✓ answered by jhardman

shouldn't you have to specify the query before you open the recordset? Or did you just leave off that part? When I get a syntax error that isn't obvious, I like to print out (response.write) the final query just to see how it looks, sometimes that's enough to see where the error is. Otherwise, you can take your final query and drop it in a query analyzer.

Jared

1 2828
jhardman
3,406 Expert 2GB
shouldn't you have to specify the query before you open the recordset? Or did you just leave off that part? When I get a syntax error that isn't obvious, I like to print out (response.write) the final query just to see how it looks, sometimes that's enough to see where the error is. Otherwise, you can take your final query and drop it in a query analyzer.

Jared
May 28 '10 #2

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

Similar topics

2
by: Martin Feuersteiner | last post by:
Hi I'm grateful for any light you can shed on this!! I've to admit, it's an unusual design but I've multiple contact tables named e.g....
3
by: Martin Mrazek | last post by:
Hi, I have tables named like ag97a027, ag98a027, ... where 97 and 98 is from year 1997, 1998 and a027 is just specification of product type. I...
1
by: russ | last post by:
Hi all, Here's a problem I'm having with a dynamic table. Following the guidelines here...
1
by: amfi1 | last post by:
Hi My problem is as follows: I need to transmit data between two databases on the same server, but I have to use dynamic database names (they...
3
by: ryanmhuc | last post by:
Is it possible to have a dynamic table name within a query or a table name that is a variable? This does not work but gives an example: SELECT *...
5
by: devx777 | last post by:
Hello, I am trying to find some information or an example on how to build a dynamic query in DB2 that would allow me to join a table which its...
1
by: kalyson | last post by:
Hello, I realize that using the TYPE declaration for variables makes their definitions more dynamic, like this: myField ...
2
by: ArizonaJohn | last post by:
Hello, Below I have some Ajax and the page it points to. This code works great if $_SESSION has no spaces in it (for example, if it is "elpaso")....
6
SBCUser666
by: SBCUser666 | last post by:
I have an Access 2003 query that does a SELECT.. INTO table_name. I would like the table_name to be a fixed value plus todays date. Example: ...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.