If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > error when querying to database from an asp page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-21-10, 16:56
franrtorres77 franrtorres77 is offline
Registered User
 
Join Date: Nov 2010
Posts: 7
error when querying to database from an asp page

Hello.

I have the following query for knowing the stopped time of some trucks of the company, this query works well in "mysql query browser" but in an asp page it tells me the next error:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[MySQL][ODBC 5.1 Driver][mysqld-5.1.33-community]Unknown system variable 'timediff'

/gps/pos.asp, línea 62



the code is this:
<%
Dim paradas
Dim paradas_numRows

Set paradas = Server.CreateObject("ADODB.Recordset")
paradas.ActiveConnection = MM_trucks_STRING
paradas.Source = "set @nexttime := "", @nextms := "", @diff := ""; select velocidad,movil,fecha, concat(fecha, replace(fecha, '.', ':')) as Time, if(@nexttime<>"", timediff(@nexttime, fecha), "") as tdiff, if(@nextms<>"", abs(@nextms-fecha), "") as msdiff, if(@nexttime<>"", concat(timediff(@nexttime, fecha), replace(abs(@nextms-fecha), '0.', ':')),"") as FinalDifference, (@nexttime:=fecha) as Next, (@nextms:=fecha) as NextMS from posiciones where velocidad=0 and movil = 1883 and fecha >(now() - interval 2 day)"
paradas.CursorType = 0
paradas.CursorLocation = 2
paradas.LockType = 1
paradas.Open()

paradas_numRows = 0
%>


Best regards and thank you.

Last edited by franrtorres77; 11-21-10 at 17:17.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On