...

View Full Version : MySQL query help



StealthRT
01-28-2007, 01:58 AM
Hey all i am in need of some help trying to get this query to work.

Here is my code


theWeek = Weekday(Date)

If theWeek = "1" Then
currentDate = DateAdd("d", 1, Now)
ElseIf theWeek = "2" Then
currentDate = DateAdd("d", 0, Now)
ElseIf theWeek = "3" Then
currentDate = DateAdd("d", -1, Now)
ElseIf theWeek = "4" Then
currentDate = DateAdd("d", -2, Now)
ElseIf theWeek = "5" Then
currentDate = DateAdd("d", -3, Now)
ElseIf theWeek = "6" Then
currentDate = DateAdd("d", -4, Now)
Else
currentDate = DateAdd("d", -5, Now)
End If

mondaysDate = FormatDateTime(currentDate, 2)
mondaysDate = "0" & mondaysDate
myFullName = "Goins, Timothy D."

Set oConnection2 = Server.CreateObject("ADODB.Connection")
Set oRecordset2 = Server.CreateObject("ADODB.Recordset")

oConnection2.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=xx.xxx.xx.xx; PORT=3306; DATABASE=xxxx; USER=xxxx; PASSWORD=xxxx; OPTION=3;"
sql2="SELECT * FROM " & "`schedule" & mondaysDate & "`" & " WHERE Name = '" & myFullName & "'"
oRecordset2.Open sql2, oConnection2,3,3

It gives me the error:


Microsoft OLE DB Provider for ODBC Drivers error '80040e21'

ODBC driver does not support the requested properties.

/Schedule.asp, line 55

Do i have the query correct? It needs to find the table named "schedule01/22/2007".

Any help would be great! :)
David



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum