sql !! arrhg!

Results 1 to 4 of 4

Thread: sql !! arrhg!

  1. #1
    mikesta Guest

    Default sql !! arrhg!

    strRemote = request.servervariables("REMOTE_ADDR")<BR>strDateT ime = Now()<BR>strSQL = "INSERT INTO siteLogging VALUES (" <BR>strSQL = strSQL & strRemote & "," <BR>strSQL = strSQL & strDateTime & "," <BR>objConn.execute(strSQL)<BR><BR>my script gives me an error that the SQL string is invalid.. that it doesnt work.. what is the corrent syntax for asp-&#062;sql???<BR><BR>please help! <BR>(posted in advanced as wells)

  2. #2
    Join Date
    Dec 1969

    Default RE: sql !! arrhg!

    you may want to put in single quote "&#039" if the field in your table are strings or even date. for data time best format is<BR>&#039yyyymmdd hh:mi&#039 for sql server but it also have a function to convert date/time. for Acess you will need the "#" e.g. #ddmmyyyy#. hope this help<BR><BR>

  3. #3
    Sathiya Guest

    Default RE: sql !! arrhg!

    If you want to know the problems easily display the strSQL using response.write ok now the problem in your code is u missed a ")" and have one "," extra<BR><BR>strSQL = "INSERT INTO siteLogging VALUES (" <BR>strSQL = strSQL & strRemote & "," <BR>strSQL = strSQL & strDateTime & ")"<BR>Try this<BR><BR>

  4. #4
    Dave Pomeroy Guest

    Default RE: sql !! arrhg!

    After the name of your table you need to list the table names then values and the values. Must be in same order.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts