Help needed please: Error Type 0x80040e14

He has: 183 posts

Joined: Nov 2003

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/intranetwork/Information/Support/Technicalsupport/network_add.asp, line 115

LINE 115: MM_editCmd.Execute

Does anyone now what the problem could be????? Thank you

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

It's probably a syntax error in your INSERT INTO statement. Wink

It does look like an error in the code, and not with the server or drivers, so it'll help to see the code. Smiling

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Can we see the query your trying to run?

He has: 183 posts

Joined: Nov 2003

Thank for the help, is this what you wanted. This is the page which i'm trying to create a form what add to the database. I have done this many times and work just on this one and some other. I have even started from scrach. I'm using Dreamweaver though, could that be a problem???

<?php
@LANGUAGE="VBSCRIPT" CODEPAGE="1252"
?>

<?php
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Request.QueryString
End If

'
boolean to abort record edit
MM_abortEdit
= false

' query string to execute
MM_editQuery = ""
?>

<?php
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "form1") Then

  MM_editConnection = MM_Intranet_STRING
  MM_editTable = "network"
  MM_editRedirectUrl = "network_results"
  MM_fieldsStr  = "document|value|date|value"
  MM_columnsStr = "document|'
,none,''|date|',none,''"

  '
create the MM_fields and MM_columns arrays
  MM_fields
= Split(MM_fieldsStr, "|")
 
MM_columns = Split(MM_columnsStr, "|")
 
 
' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  '
append the query string to the redirect URL
 
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
   
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl
= MM_editRedirectUrl & "?" & Request.QueryString
   
Else
     
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End
If
 
End If

End If
?>

<?php
' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

  '
create the sql insert statement
  MM_tableValues
= ""
 
MM_dbValues = ""
 
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal
= MM_fields(MM_i+1)
   
MM_typeArray = Split(MM_columns(MM_i+1),",")
   
MM_delim = MM_typeArray(0)
    If (
MM_delim = "none") Then MM_delim = ""
   
MM_altVal = MM_typeArray(1)
    If (
MM_altVal = "none") Then MM_altVal = ""
   
MM_emptyVal = MM_typeArray(2)
    If (
MM_emptyVal = "none") Then MM_emptyVal = ""
   
If (MM_formVal = "") Then
      MM_formVal
= MM_emptyVal
   
Else
      If (
MM_altVal <> "") Then
        MM_formVal
= MM_altVal
     
ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & "
,"
      MM_dbValues = MM_dbValues & "
,"
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "
insert into " & MM_editTable & " ('" & MM_tableValues & ") values (" & MM_dbValues & ")"

  If (Not MM_abortEdit) Then
    '
execute the insert
    Set MM_editCmd
= Server.CreateObject("ADODB.Command")
   
MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd
.CommandText = MM_editQuery
    MM_editCmd
.Execute
    MM_editCmd
.ActiveConnection.Close

   
If (MM_editRedirectUrl <> "") Then
      Response
.Redirect(MM_editRedirectUrl)
   
End If
 
End If

End If
?>

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

MM_editQuery = "insert into " & MM_editTable & " ('" & MM_tableValues & ") values (" & MM_dbValues & ")"

You have a single quote ' that isn't closed after MM_tableValues. Change the above to:

MM_editQuery = "insert into " & MM_editTable & " ('" & MM_tableValues & "') values (" & MM_dbValues & ")"

He has: 183 posts

Joined: Nov 2003

Thanks 4 that. Is that a dreamweaver fault then???? Oh well. Thank god i have you people. thank you!!!

He has: 183 posts

Joined: Nov 2003

Sorry, i think i'm still having a problem with the code. I have change the above code which was sent to the one that looked like the right code, but it does not seem to have change.

Is it the part in red that i should be changing, or is there some other part i have to change?

<?php
@LANGUAGE="VBSCRIPT" CODEPAGE="1252"
?>

<?php
' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If

'
boolean to abort record edit
MM_abortEdit
= false

' query string to execute
MM_editQuery = ""
?>

<?php
' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "form1") Then

MM_editConnection = MM_Intranet_STRING
MM_editTable = "network"
MM_editRedirectUrl = "network_results"
MM_fieldsStr = "document|value|date|value"
MM_columnsStr = "document|'
,none,''|date|',none,''"

'
create the MM_fields and MM_columns arrays
MM_fields
= Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")

' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next

'
append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl
= MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End
If
End If

End If
?>

<?php
' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

'
create the sql insert statement
MM_tableValues
= ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal
= MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (
MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (
MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (
MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal
= MM_emptyVal
Else
If (
MM_altVal <> "") Then
MM_formVal
= MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & "
,"
MM_dbValues = MM_dbValues & "
,"
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "
insert into " & MM_editTable & " ('" & MM_tableValues & ") values (" & MM_dbValues & ")"

If (Not MM_abortEdit) Then
'
execute the insert
Set MM_editCmd
= Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd
.CommandText = MM_editQuery
MM_editCmd
.Execute
MM_editCmd
.ActiveConnection.Close

If (MM_editRedirectUrl <> "") Then
Response
.Redirect(MM_editRedirectUrl)
End If
End If

End If
?>

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Yep, it is that line. I've highlighted it for you. Smiling

I don't know if you should remove the first single quote or add one at the second point... haven't done this for a long time. Try both, I suppose. Wink

He has: 183 posts

Joined: Nov 2003

Thanks for that. I will give it a try!!!! Smiling

He has: 183 posts

Joined: Nov 2003

Hi, i have tryed what you said above, and it still dont work. There must be something else not working. I'm using Dreamweaver MX, and it has work before when creting and insertion form. But when doing this one thing it will not work.

He has: 183 posts

Joined: Nov 2003

Hi. This is the page which work OK, using Dreamweaver. This is just adding a record.

<?php
@LANGUAGE="VBSCRIPT" CODEPAGE="1252"
?>

<?php

' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../Staff/staff_login.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
?>

<?php

' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Request.QueryString
End If

'
boolean to abort record edit
MM_abortEdit
= false

' query string to execute
MM_editQuery = ""
?>

<?php

' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "form1") Then

  MM_editConnection = MM_Intranet_STRING
  MM_editTable = "Weblinks"
  MM_editRedirectUrl = "weblink_added.asp"
  MM_fieldsStr  = "Title|value|url|value|Description|value"
  MM_columnsStr = "Title|'
,none,''|url|',none,''|Description|',none,''"

  ' create the MM_fields and MM_columns arrays
  MM_fields = Split(MM_fieldsStr, "
|")
  MM_columns = Split(MM_columnsStr, "
|")
 
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "
?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "
?" & Request.QueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "
&" & Request.QueryString
    End If
  End If

End If
?>

<?php

' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

  '
create the sql insert statement
  MM_tableValues
= ""
 
MM_dbValues = ""
 
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal
= MM_fields(MM_i+1)
   
MM_typeArray = Split(MM_columns(MM_i+1),",")
   
MM_delim = MM_typeArray(0)
    If (
MM_delim = "none") Then MM_delim = ""
   
MM_altVal = MM_typeArray(1)
    If (
MM_altVal = "none") Then MM_altVal = ""
   
MM_emptyVal = MM_typeArray(2)
    If (
MM_emptyVal = "none") Then MM_emptyVal = ""
   
If (MM_formVal = "") Then
      MM_formVal
= MM_emptyVal
   
Else
      If (
MM_altVal <> "") Then
        MM_formVal
= MM_altVal
     
ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & "
,"
      MM_dbValues = MM_dbValues & "
,"
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "
insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"

  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("
ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
?>

<?php

Dim Weblinksadd
Dim Weblinksadd_numRows

Set Weblinksadd
= Server.CreateObject("ADODB.Recordset")
Weblinksadd.ActiveConnection = MM_Intranet_STRING
Weblinksadd
.Source = "SELECT Title, url, Description FROM Weblinks"
Weblinksadd.CursorType = 0
Weblinksadd
.CursorLocation = 2
Weblinksadd
.LockType = 1
Weblinksadd
.Open()

Weblinksadd_numRows = 0
?>

Here is the code which is to the page that DOES NOT WORK! again, using dreamweaver. The same way.

<?php
@LANGUAGE="VBSCRIPT" CODEPAGE="1252"
?>

<?php

' *** Edit Operations: declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Request.QueryString
End If

'
boolean to abort record edit
MM_abortEdit
= false

' query string to execute
MM_editQuery = ""
?>

<?php

' *** Insert Record: set variables

If (CStr(Request("MM_insert")) = "form2") Then

  MM_editConnection = MM_Intranet_STRING
  MM_editTable = "Dairy"
  MM_editRedirectUrl = "index_added.asp"
  MM_fieldsStr  = "Time|value|Day|value|Month|value|Description|value"
  MM_columnsStr = "Time|'
,none,NULL|Day|',none,''|Month|',none,''|Description|',none,''"

  '
create the MM_fields and MM_columns arrays
  MM_fields
= Split(MM_fieldsStr, "|")
 
MM_columns = Split(MM_columnsStr, "|")
 
 
' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
  Next

  '
append the query string to the redirect URL
 
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
   
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
      MM_editRedirectUrl
= MM_editRedirectUrl & "?" & Request.QueryString
   
Else
     
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
    End
If
 
End If

End If
?>

<?php

' *** Insert Record: construct a sql insert statement and execute it

Dim MM_tableValues
Dim MM_dbValues

If (CStr(Request("MM_insert")) <> "") Then

  '
create the sql insert statement
  MM_tableValues
= ""
 
MM_dbValues = ""
 
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal
= MM_fields(MM_i+1)
   
MM_typeArray = Split(MM_columns(MM_i+1),",")
   
MM_delim = MM_typeArray(0)
    If (
MM_delim = "none") Then MM_delim = ""
   
MM_altVal = MM_typeArray(1)
    If (
MM_altVal = "none") Then MM_altVal = ""
   
MM_emptyVal = MM_typeArray(2)
    If (
MM_emptyVal = "none") Then MM_emptyVal = ""
   
If (MM_formVal = "") Then
      MM_formVal
= MM_emptyVal
   
Else
      If (
MM_altVal <> "") Then
        MM_formVal
= MM_altVal
     
ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_tableValues = MM_tableValues & "
,"
      MM_dbValues = MM_dbValues & "
,"
    End If
    MM_tableValues = MM_tableValues & MM_columns(MM_i)
    MM_dbValues = MM_dbValues & MM_formVal
  Next
  MM_editQuery = "
insert into" & MM_editTable & " (" & MM_tableValues& ") values (" & MM_dbValues & ")"

  If (Not MM_abortEdit) Then
    ' execute the insert
    Set MM_editCmd = Server.CreateObject("
ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
?>

<?php

' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../Staff/staff_login.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
?>

<?php

Dim AddtoDiary
Dim AddtoDiary_numRows

Set AddtoDiary
= Server.CreateObject("ADODB.Recordset")
AddtoDiary.ActiveConnection = MM_Intranet_STRING
AddtoDiary
.Source = "SELECT * FROM Dairy"
AddtoDiary.CursorType = 0
AddtoDiary
.CursorLocation = 2
AddtoDiary
.LockType = 1
AddtoDiary
.Open()

AddtoDiary_numRows = 0
?>

Hope this could help anyone who can help me. Thank for all your time. This is a major problem for me. Until i find out how to sort this problem out i can more on.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Did you try it with no single quotes at all?

Not sure what the problem is... lemme see if I can find something useful in one of these thick ASP books I have lying around. Smiling

He has: 183 posts

Joined: Nov 2003

Thanks for that. Yes i have done. Still no change.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Try printing out the values of tableValues and dbValues and check that the data is correct, is delimited properly, and has correct quotes.

He has: 183 posts

Joined: Nov 2003

I'm going to create a new database and page and start from scratch. If that dont work then i will get back in touch. Thanks for you time anyway. Ya great!

He has: 183 posts

Joined: Nov 2003

hi, i have created a new database, new name, new site, new everything and it still comes up with the same error as above.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

My suspicion is the the values for tableValues and dbValues are incorrect, and that's throwing the INSERT SQL syntax off.

The SQL statement is generated by the code just prior to it, and I think there may be an error in there. So check that its output is correct for the SQL by printing those two variables...

EDIT: even better, have you preserved the same structure for the database? What are your field names? [link]

He has: 183 posts

Joined: Nov 2003

Sorry, this may sound stuiped but were do i find that. Im only a novice!

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

heh, no worries. Smiling A field is equivalent to a "column", whereas a record is equivalent to a "row", in a table within a database. So what we want in this case is the names of the fields/columns in your database. If you're using a reserved word in ASP (used by the language for some other thing) for any of their names, then it'll be what's causing the damage. Smiling

He has: 183 posts

Joined: Nov 2003

Ok, then the table colums are Time, Day, Month, Description.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Ah! Smiling Now that'd be the problem. "Time" is a disallowed (reserved) keyword. Not sure about Day, Month and Description, but any of them may be reserved too. I suggest you rename Day and Month to something non-generic. Perhaps something like submission_time or hit_time or requested_time or something (whatever's relevant).

Also, it may be wiser to store timestamps in just one column and use ASP/VBScript date or string functions to do whatever you need.

He has: 183 posts

Joined: Nov 2003

Now thatwouldmake sense, because i was working on a diffurant project,and again i used Time, Date. I dont really need to call the Time and Date as Time and Date, aslong as the user see that they need to input time and date. I shall have a go with that. But it does make sense now. That you so ever so much for you help and time!!!!

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

No problems. Too bad it took so long... should've Googled earlier. Wink

Btw, my Sams books seems to suggest using separate columns as you're doing now, if you still want to use the dates and times. I guess I'm just used to keeping it in one from PHP/MySQL. Smiling

Here's two lists you might find useful later. ASP/databases reserved keywords and MS SQL reserved keywords.

He has: 183 posts

Joined: Nov 2003

All that i wanted to do was an insertion form, so that the user would add the time and date in to a diary,which is the hole datbase thing.
Just one last thing: Is it best to use one table in a database for each project. At the moment i use loads of diffurant tables but in the same database.for example. I have a diary, weblink database, computer fault report, which uses a lot of tables and there will be more.

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

If your host allows, I'd recommend you use a different database for each different project. Unless the "projects" are under one umbrella -- like you might have a sales record, a customer list, and a daily log for a computer store.

Just keep in mind that Access is a weak DB and can become mercurial even with a few simultaneous connections.

He has: 183 posts

Joined: Nov 2003

cool. I change the colums, create a new database and new pages, but now it seems to be coming up with an (0x80004005) Operation must use an updateable query.

Im going to try again.

He has: 183 posts

Joined: Nov 2003

No its still coming up with that same error as above. I'm i doing something wrong? I'm doing it the same way i use to. two pages. One called results.asp (with a Dynamic table) and diary_add.asp (Record Insertion Form) When i have inserted a record it should work then send them back to results.asp. But it dont....

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

You may run into the problem again. Try the solution given here: http://support.codecharge.com/kb_article.asp?s_prod=2&article_id=4
or here: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=107

... and if it still gives you that error, you'll have to reboot and give it a try. Smiling

He has: 183 posts

Joined: Nov 2003

I shall have a go. Thanks for the help again. I posted the same message on other forums, this is the only forum were people do help each other!!!

He has: 183 posts

Joined: Nov 2003

It works!!!!!!!!!!! It works!!!!!!! It didnt have the "everyone" on the database and now it works. You have put a smile on my face. thank you so ever so much!!!! you learn new things everyday!!!!! Smiling

Abhishek Reddy's picture

He has: 3,348 posts

Joined: Jul 2001

Excellent! Laughing out loud

They have: 30 posts

Joined: Aug 2003

if you want to use a restricted word (like insert, select, time, etc) as your database/field name, you will need to treat it differenty in your scripts. in MS SQL put brackets around it:

UPDATE users SET [time]=25;

in MySQL use back quotes:

UPDATE users SET `time`=25;

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.