ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old April 16th, 2008, 10:19 AM
dragan dragan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 38 dragan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 28 m 58 sec
Reputation Power: 1
Database - General - ASP to MySQL

When I run my application I get this error:


Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-5.0.51a-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
/blog2/default.asp, line 38


error line:

rsLayout.Execute = "SELECT layout1, layout2, layout3, layout4, layout5 from tblLayout WHERE layoutid = " & layout

Please Help!

Reply With Quote
  #2  
Old April 17th, 2008, 02:54 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 9,962 micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 2 Weeks 4 Days 13 h 54 m 16 sec
Reputation Power: 1275
whats the output of the query??
just check if you have value for variable layout in ur query.
__________________
Laziness is my religion and Sunday is my God

Get the Mantra!

Reply With Quote
  #3  
Old April 17th, 2008, 03:32 AM
dragan dragan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 38 dragan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 28 m 58 sec
Reputation Power: 1
My table is:

CREATE TABLE `tblLayout` (
`layoutid` INTEGER NOT NULL AUTO_INCREMENT,
`layout1` TEXT,
`layout2` TEXT,
`layout3` TEXT,
`layout4` TEXT,
`layout5` TEXT,
`layoutTitle` VARCHAR(100) NOT NULL,
INDEX (`layoutid`),
PRIMARY KEY (`layoutid`)
) TYPE=MyISAM;


I convert my database from MS Access to MySQL...

I dont know where is error!

Reply With Quote
  #4  
Old April 17th, 2008, 03:34 AM
soft903's Avatar
soft903 soft903 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 155 soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level)soft903 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 13 m 58 sec
Reputation Power: 55
Hi,

I haven't used MYSQL, so I might be wrong.

Is rsLayout as Recordset type?
Not sure Recordset.Execute = strSQL works.

Try
rsLayout .Open strSQL, conn
OR
Set rsLayout =conn.Execute(strSQL)
where conn is a Connection

Hope it helps

Reply With Quote
  #5  
Old April 17th, 2008, 03:35 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,397 Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 3 Days 22 h 32 m 47 sec
Reputation Power: 1311
--moved to the ASP forum

the variable "layout" is empty, in order to have value there you have
to do something known in programming as "assigning value".
for example:

Code:
layout = 57


by having the above line you will assign the value 57
into the variable and you won't get such error anymore.

Reply With Quote
  #6  
Old April 17th, 2008, 03:40 AM
hsitas hsitas is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 hsitas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 18 sec
Reputation Power: 0
Smile Query error line no 38

error line:38
Code:
 
change like this...

rsLayout.Execute("SELECT layout1, layout2, layout3, layout4, layout5 from tblLayout WHERE layoutid = " & layout)


if it is not working try this
<%
Set dbcon=server.createobject("adodb.connection")
Set Recordset = Server.CreateObject("ADODB.Recordset")



   ConnString = "DRIVER={MySQL ODBC 3.51 Driver};Port=3306; SERVER=localhost; DATABASE=dblogin; " &_
    "UID=xxxx;PASSWORD=xxxx1234; OPTION=3"

    dbcon.open ConnString
    set rs=dbcon.execute("select * from datastime where edate='"&newdate&"' and staffid="&mstaffid)
    if not rs.eof then
response.write("").....

%>

Reply With Quote
  #7  
Old April 17th, 2008, 08:48 AM
dragan dragan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 38 dragan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 28 m 58 sec
Reputation Power: 1
Thank's I solve my problem with SQL...

Thanks for all your replies but now have another error.


Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch
/primer/inc_sidebar.asp, line 72


error line:

<% if rsCats.Fields.Item("CatCount").Value >= 1 then %>


Thanks again...

Reply With Quote
  #8  
Old April 17th, 2008, 09:44 AM
richyrich's Avatar
richyrich richyrich is offline
Contributing User
ASP Free Specialist (4000 - 4499 posts)
 
Join Date: Jun 2004
Location: Somewhere only we know...
Posts: 4,166 richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)richyrich User rank is General 3rd Grade (Above 100000 Reputation Level)  Folding Points: 96456 Folding Title: Advanced FolderFolding Points: 96456 Folding Title: Advanced FolderFolding Points: 96456 Folding Title: Advanced FolderFolding Points: 96456 Folding Title: Advanced FolderFolding Points: 96456 Folding Title: Advanced Folder
Time spent in forums: 2 Months 1 Week 14 h 25 m 17 sec
Reputation Power: 1177
Is CatCount an integer field?

Also check for a null value:-
Code:
if isnull(rsCats.Fields.Item("CatCount")) then
'do something
else
'do something else
end if
__________________
Policy Check

I'd rather have a full bottle in front of me, than a full frontal lobotomy...

Reply With Quote
  #9  
Old April 17th, 2008, 10:22 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information.
 
Join Date: Sep 2004
Location: Israel
Posts: 26,397 Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 5th Grade (Above 100000 Reputation Level)  Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1Folding Points: 313769 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 3 Days 22 h 32 m 47 sec
Reputation Power: 1311
try this:
Code:
<%
If IsNull(rsCats("CatCount")) Then
   'value is null!
Else  
   If CInt(rsCats("CatCount")) >= 1 Then
      'do something
   Else  
      'do something else
   End If
End If
%>

Reply With Quote
  #10  
Old April 17th, 2008, 11:03 AM
dragan dragan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 38 dragan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 28 m 58 sec
Reputation Power: 1
this help

Thank's

Reply With Quote
  #11  
Old April 17th, 2008, 11:27 AM
dragan dragan is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 38 dragan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 28 m 58 sec
Reputation Power: 1
Finaly my apllication is ready

Thank's again

Reply With Quote
  #12  
Old April 18th, 2008, 02:34 AM
micky's Avatar
micky micky is offline
Couch Potato Wizard
Click here for more information. Click here for more information
 
Join Date: Jan 2005
Location: India
Posts: 9,962 micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)micky User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 1480 Folding Title: Novice Folder
Time spent in forums: 3 Months 2 Weeks 4 Days 13 h 54 m 16 sec
Reputation Power: 1275
glad u got it all working

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Database - General - ASP to MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump