Click to See Complete Forum and Search --> : adoConnecction Update


dfaulks
11-30-2003, 03:41 PM
I am trying to insert into a visual foxpro database with the following code:


<%@ LANGUAGE = JavaScript%>
<%
var adoConnection = Server.CreateObject("ADODB.Connection");

var constring = "Provider=VFPOLEDB.1;Data Source=D:\\test\\test.dbc";

adoConnection.Open(constring);
var today

today = "12/12/2003";

adoConnection.Execute("INSERT INTO table1 (date) VALUES(today)");

adoRecordSet.Close();
adoRecordSet = null;
adoConnection.Close();
adoConnection = null;
%>

Apparently the variable is not being seen by the command. What am I doing wrong???????????????

I receive the following error message when running the script.

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)
· Error Type:
Microsoft OLE DB Provider for Visual FoxPro (0x80004005)
Variable 'TODAY' is not found.
/counter2.asp, line 12
· Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; T312461; AT&T CSM7.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)
· Page:
GET /counter2.asp
· Time:
Sunday, November 30, 2003, 1:57:04 PM
· More information:

ray326
11-30-2003, 07:23 PM
Try something like this:

adoConnection.Execute("INSERT INTO table1 (date) VALUES("+today+")");

dfaulks
11-30-2003, 07:42 PM
Thanks for the try but no luck!

I tried the following variations with no help

adoConnection.Execute("INSERT INTO table1 (date) VALUES("+today+")");
('+today+')");


it just inserts the string "+today+" into the database rather than the value of the variable TODAY.

Every example I see of this type of code seems to suggest that using a variable passed to this cammand will work.

Is it possible I have a driver problem??