Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 10th, 2008, 07:56 PM
Registered User
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Syntax error in FROM clause: asp

Using Dreamweaver 8 and Access 2007 I am trying to build asp pages. Creating a new page in Dreamweaver and then in the Database tab I add a new custom connection string:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Inetpub\wwwroot\test\data\Melissa.accdb; Persist Security Info=False;

Testing the connection from there give the message Connection made successfully so far so good. The only red flag at this point is I expand the selection (by click on the "+" sign and the table name gives me the name "null.yonkers"...the name of the table is "yonkers" but the "null" is something I haven't seen before.

Now going to the Bindings tab I insert a recordset. This is where I start to see real problems. The drop-down list also gives me "null.yonkers" for the table name. And when I click "test" it gives me the error message "Syntax error in FROM clause".

I've tried busting permissions as far open as I can, at least I think I have. Here is the code for the asp page:

Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_smarty_STRING
Recordset1.Source = "SELECT * FROM null.yonkers"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

And then here is the code for the recordset page that Dreamweaver creates in the Connections folder (that it also creates automatically).

<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="true"
' Catalog=""
' Schema=""
Dim MM_smarty_STRING
MM_smarty_STRING = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Inetpub\wwwroot\test\data\ThisIsSmart.ac cdb;Persist Security Info=False;"
%>

Pls let me know if you have any questions.

 
Old July 10th, 2008, 08:35 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

First of all, you posted in the wrong forum. This is an ASP.NET forum.

You are coding old-style ASP.

But anyway...

NULL is a keyword in SQL and clearly can't be part of the name of a table.

So don't you *KNOW* the name of the table you want to use???? If so, why not just type it in and stop relying on DumbWaster to do the wrong thing for you?
 
Old July 15th, 2008, 11:36 AM
Registered User
 
Join Date: Jul 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. The multiple question marks are a big help.

 
Old July 15th, 2008, 03:30 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Not a good response if you want to continue getting some help here.

Kind regards,
Richard

 
Old July 15th, 2008, 08:33 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

You know, I really am curious why DumbWeaver gave him "null.yonkers" as a possible table name.

Is it possibly because DW doesn't really quite understand Access2007 databases???

[LOL! At myself! I really did just type that in with all 3 question marks WITHOUT thinking about it! It's just the way I type. When something is really weird or unbelievable to me, it merits more than one piece of punctuation. So he just got upset over my own personal foible that really had nothing to do with him, per se.]
 
Old July 15th, 2008, 10:50 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

I never did much like a program doing for me what I could do for myself even though there are a lot of people here who use Dreamweaver quite successfully. This really isn't the Dreamweaver forum anyway. I don't know a thing about DW and would try to help anyway but I have no idea where DW is getting its table info.

I often type more than one (?). It's kinda like, what, what the, what is up with that. I don't think it was the multiple ?'s that insulted jpindi. His retort is actually kind of funny though.

Really, isn't there a place to input a SQL query in DW? Just testing the connection only means that your app can connect to the DB and not to a particular table. You'd probably do better off though in a DW forum.

Regards,
Richard

 
Old July 16th, 2008, 12:30 AM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

I don't use DW myself, but I've helped dozens and more who have, and DW is perfectly fine with letting you type in the SQL query yourself. Just ignore whatever it produces by default and then go to the code view and change it to what you need and it's quite happy.

So long as DW can actually *make* that query against the given DB, it really doesn't even know that it's not a query that it created, as I understand it.





Similar Threads
Thread Thread Starter Forum Replies Last Post
syntax for where clause with like operator Yasho VB.NET 2002/2003 Basics 2 June 11th, 2007 08:34 AM
asp help for newbie syntax error jennypretty Classic ASP Basics 2 June 1st, 2007 01:08 PM
ASP.NEt syntax error crmpicco ASP.NET 2.0 Basics 5 December 7th, 2006 12:54 PM
Syntax error in query. Incomplete query clause. dispickle ADO.NET 3 April 16th, 2004 01:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.