|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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! |
|
#2
|
||||
|
||||
|
whats the output of the query??
just check if you have value for variable layout in ur query. |
|
#3
|
|||
|
|||
|
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! |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
--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. |
|
#6
|
|||
|
|||
|
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("").....
%>
|
|
#7
|
|||
|
|||
|
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... |
|
#8
|
||||
|
||||
|
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...
|
|
#9
|
||||
|
||||
|
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
%>
|
|
#10
|
|||
|
|||
|
this help
Thank's ![]() |
|
#11
|
|||
|
|||
|
Finaly my apllication is ready
Thank's again |
|
#12
|
||||
|
||||
|
glad u got it all working
![]() |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > Database - General - ASP to MySQL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|