Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help, please - OLEDB for ODBC driver error.
Message
From
20/11/2001 08:41:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00583562
Message ID:
00583862
Views:
47
This message has been marked as the solution to the initial question of the thread.
>Fantastic, but... I need a datetime value to fill a datetime field and the Transform function returns a string. May be I can apply CTOT(Transform(...))
>What do you think about it?

Yes it returns a string. But as far as I remember you said (and title says that) you were using OLEDB for ODBC driver. Then sending the string in ODBC canonical format to a date or datetime field is fairly legal. ie :
&lt%
set Conntemp = server.CreateObject ("adodb.connection")
dbpath=server.mappath ("data")
Conntemp.Open "DRIVER=Microsoft Visual FoxPro Driver;" _
 & "Collate=Machine;" _
 & "BackgroundFetch=Yes;" _
 & "Exclusive=No;" _
 & "SourceType=DBC;" _
 & "SourceDB=" & dbpath & "\testdata.dbc"

Set lrs = CreateObject("adodb.Recordset")
lrs.Open "employee", Conntemp, 3,3,2
lrs.addnew 
lrs("emp_id") = "dummy"
lrs("first_name")= "cetin"
lrs("last_name")= "basoz"
lrs("birth_date")= "1961/01/19"
lrs.Update
			
Response.Write("<p>Inserted record: " & lrs("First_Name") & " " & lrs("Last_Name") & lrs("emp_id"))
lrs.Close
set lrs = nothing
conntemp.Close
set db = nothing
%&gt
Notice that birthdate is string in YYYY/MM/DD format.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform