I have two tables: CONTACTS -- ContactID is autonumber type; now I try to get the Max(ContactID) and insert into VENDORS table. (Below it is the SQL code)
Can you see anything wrong? especially SQL_query
I got syntax error.. Thank you very much!!!
Also, I designed a relational database, I seem remember a artile saying it is NOT good idea to use autonumber field???
================================================
<%@ Language=VBScript%>
<%
On Error Resume Next
.. Create objConn
SQL_contactQuery = "select MAX(ContactID) as maxContact from CONTACTS"
Set RS_contact = MyConn.Execute(SQL_contactQuery)
SQL_query = "insert into VENDORS(VendorName, ContactID) values('" & Query_bizName & "," & RS_contact('maxContact') & ")"
objConn.Execute(SQL_query)
%>
========================================================