Click to See Complete Forum and Search --> : time() with sql


ozpo1
03-20-2006, 12:53 PM
Hi, I'm using asp to send information to mysql database.

One of the variabels that I'm sending is:

tsime=time()

and my problem is that when I'm calling this page I get the following error:

Microsoft VBScript runtime error '800a000d'

Type mismatch: '[string: "(Contractor,Service,"]'

/FinalStep.asp, line 27

I know the problem is because I'm using time(), because when I give a fix value to tsime it's working just fine.

In mysql defination, tsime is TIME, what is wrong? how can I FIX IT?
Thanks in advanced, Oz.

This is line 27:

objConn.Execute("INSERT INTO " & session("dbCategory") & "(Contractor,Service,ProjectStarts,Commercial,SquareFotage,FirstName,LastName,City,ZipCode,Email,Phon eNumber,Time) VALUES( '" + contractor + "' , '" + service + "', '" + ProjectStarts + "', '" + Commercial + "', '" + SquareFotage + "','" + FirstName +"','" + LastName +"','" + City + "','" + session("zipcode") +"', '" + Email + "','" + PhoneNumber + "','" + tsime + "')")

Ubik
03-20-2006, 02:07 PM
Try placing brackets around your 'time' field:

objConn.Execute("...,PhoneNumber,[Time])


Also, I usually format my dates, just in case:

tsime =DateAdd("d", 0, now()&" 12:00 AM")

If you can modify your database tables, probably the best way to overcome this is to set the field to disallow NULL values, and set the default to now().

ozpo1
03-20-2006, 03:22 PM
Any other idea?
it still write me the same problem, I tried everything except formating the date, because I didn't really understand what does it mean, and if it is in ASP language. Any other idea?

ozpo1
03-20-2006, 05:04 PM
Thanks for the help