IIS - Problems with UPDATE

Asked By David
05-Jun-07 05:23 AM
Hi,

I am trying to create a simple ASP web counter for my site, but seem
to have an error somewhere ???
I am connecting to a MySQL server (works fine)

hit-marker = Varchar
hit_date = Date
hit-browser = Varchar



marker = 1

browser = Request.ServerVariables("http_user_agent")

hitdate = date()
yy = Year(hitdate)
mm = Month(hitdate)
dd = Day(hitdate)
S_date = yy & "/" & mm & "/" & dd

Set adoDataConn = Server.CreateObject("ADODB.Connection")
adoDataConn.Open conn_string

uSQL = "INSERT INTO Webwiz (hit-marker, hit_date, hit-browser) VALUES
('" & marker & "'," & S_date & ",'" & browser & "');"
set RS = adoDataConn.Execute(uSQL)

%>

I keep getting the following error:

----------------------------------------------------------------

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

[MySQL][ODBC 3.51 Driver][mysqld-4.1.22-standard]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 '-marker, hit_date,
hit-browser) VALUES ('1',2007/6/5,'Mozilla/5.0 (Windows; U; W' at line
1

/hitwise.asp, line 20

________________________________________

What am I doing wrong ?
Any advise would be a great help  :-)

Thanks in advance

David
MySQL
(1)
SQL Server
(1)
ASP.NET
(1)
UPDATE
(1)
ASP
(1)
ODBC
(1)
MVP
(1)
MSFTNGP
(1)
  Bob Barrows [MVP] replied...
05-Jun-07 06:46 AM
I don't use MySQL, but I suspect you are passing the date incorrectly. To
the query parser 2006/6/5 looks like 2006 divided by 6 divided by 5, a
formula which is unlikely to correspond to a valid date value. Look up in
the MySQL documentation to see how date literals are supposed to be used in
sql statements. In SQL Server, they have to be delimited with apostrophes.

If that's not it, then I suspect the query parser may be getting confused by
the hyphens in the column names. Can you change the names of those columns?
If so, that would be my course of action. If not, then you will need to
delimit the column names to tell the parser to accept them as they are. In
SQL Server, I would use brackets [hit-marker] . Check the MySQL
documentation to verify what delimiters should be used for identifiers.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
  Adrienne Boswell replied...
05-Jun-07 09:56 AM
Gazing into my crystal ball I observed "Bob Barrows [MVP]"


Dates in MySQL: 'MM-DD-YYYY'





--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
help
everywhere online to find an alternative method besides using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no luck at all. I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP instead. However I have tried that as well the page being freezing up. . :( I saw someone here said don't use XMLHTTP in ASP as it is not thread safe (is that why it is freezing up??), and suggest 3.0 will help? i.e. not freezing up the page? Please help!!!!!! Vanessa IIS ASP Discussions Microsoft.ServerXMLHTTP (1) Microsoft.XMLHTTP (1) VmFuZXNzYQ (1) OXML.documentElement.setAttribute (1) OXMLHttp.setTimeouts (1) Server.CreateObject (1) ASP.NET (1) WinHTTP (1) = ?Utf-8?B?VmFuZXNzYQ = = ? = wrote on 12 jul 2007 in microsoft.public
First steps in running ASP.NET on IIS IIS I am attempting to set up IIS on WinXpPro (and thus IIS one called demo1. I also twiddled properites for Default Web Site and (I think) enabled ASP.NET by selecting the sole choice from the drop-down box on the ASP.NET tab. I then created a simple html page "trial1" and stored it both as a are not authorized to view this page" (2) Loading http: / / localhost / demo1 / trial1.aspx yields "Server Application Unavailable". (3) If I move trial1.html to C: \ Inetpub \ wwwroot, then http: / / localhost trial1.aspx to C: \ Inetpub \ wwwroot, it still yields the error (5) Loading the default asp file http: / / localhost / localstart.asp works OK (curiously though it first asks me for my
of the webservers in our farm have hit situations where they've popped up the ASP.Net "Server Application Unavailable" page and won't serve any asp.net pages until we recycle the app pool. What I've noticed when we have these we are going to play around with those settings as well. Normally, if you see ASP.Net return "503 Server Application Unavailable", it is a problem with the ASP.net pages, not ASP.Net itself
IIS Hi, I have these tables with binary data stored in tinyblobs and blobs in MySql. In my application I sometimes need to copy them to another table. Not all the binary stuff. Thats the thing that causes the error. Please can you help. Thanx IIS ASP DB Discussions MySQL (1) ASP.NET (1) MyISAM (1) Response.Write (1) Cecexe.execute (1) Bm9ybWFucA (1) VBScript (1) Database (1) I've never worked with mysql, but this statement would make me absolutely reject it as a database-of-choice if you do a simple "INSERT INTO tablename (<column list> ) SELECT <column list> FROM othertable" in MySQL? - - Microsoft MVP - ASP / ASP.NET Please reply to the newsgroup. This email account is my spam trap so
simple database in frontpage3 without asp support IIS I have a very simple sports club web but want to add a Easy??? I find out that my hosting company runs linux / apache and does not support ASP. Latest advice is to embed PHP into Frontpage and use a SQL db. SURELY THERE MUST BE A SIMPLER WAY!!! This must be the simplest of requirements have solved but i cannot track the answer down on the web. FrontPage Client Discussions SQL Server (1) MySQL (1) Expression Web (1) Linux (1) Database (1) ServiceLogin (1) Windows (1) Symonds (1) No there is not To access any database on your site you need server side code - which type depends on what your host supports There are "free" downloads of the appropriate server side code to do what you want - search Google for free PHP MySQL database managers