Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Has anyone used VFPOLEDB to update data ?
Message
From
21/11/2001 09:09:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/11/2001 09:08:22
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00583878
Message ID:
00584436
Views:
30
Problem solved :-)
VFPOLEDB can insert, update etc :)))
If you can please read last note. It's hanging problem for me.
I feel like a dumb !!!
Apologizes to all of you and Fox team for false alarm. It was ODBC trial working first time drove me thinking VFPOLEDB didn't. As far as I remember I didn't change anything between trials except connstring but obviously I was wrong. Anyway to my surprise it was one of the files (employee.fpt) where IUSR_ right for 'Write' was not given. I'll never know how all but this file didn't have 'write' option. This is bad luck :) If I had tried with any other tables I'd succeed at first try.
Michael you told me to check it in your first prompt response and I really thought I did already and despite I did recheck security settings missed this one :(
I want to heartedly thanks to all of you replied and want to give 3 stars all of you but you know it's impossible.

OK and here is my working ASP prototype :
&lt%
'Self note: Check default and null on target - How to set null off ?
cSQLSelect = "select * from employee"
cSQLInsert = "insert into employee (emp_id,First_name,last_name,hire_date) values ('CBASOZ','Cetin','Basoz',date())"
cSQLUpdate = "update testdata!employee " &_
   "set " &_
   "Birth_date = {^1961/01/19}, "	& _
   "Title = 'FoxyClasses Developer' " & _
   "where emp_id = 'CBASOZ'" 

    dbpath = Server.MapPath("data")
    set oConnection = Server.CreateObject( "adodb.connection" ) 
    with oConnection
       .ConnectionString = "Provider=VFPOLEDB.1;data source=" & _
           dbpath & "\testdata.dbc"
       .Open
       .Errors.Clear	
       .Execute( cSQLInsert )
       .Execute( cSQLUpdate )
       Set rs = .Execute( cSQLSelect )
    end with
    ' Check results
    Response.Write("&ltTABLE border='1'&gt&ltTR&gt&ltTD&gtEmp Id&lt/TD&gt" & _
    "&ltTD&gtFirst Name&lt/TD&gt" &_
    "&ltTD&gtLast Name&lt/TD&gt&ltTD&gtTitle&lt/TD&gt&ltTD&gtBorn&lt/TD&gt&ltTD&gtHired&lt/TD&gt&lt/TR&gt" )
    while not rs.eof
            Response.Write("&ltTR&gt")
            Response.Write("&ltTD&gt" & rs.Fields("emp_id").value & "&lt/TD&gt")
            Response.Write("&ltTD&gt" & rs.Fields("first_name").value & "&lt/TD&gt")
            Response.Write("&ltTD&gt" & rs.Fields("last_name").value & "&lt/TD&gt")
            Response.Write("&ltTD&gt" & rs.Fields("title").value & "&lt/TD&gt")
            Response.Write("&ltTD&gt" & rs.Fields("birth_date").value & "&lt/TD&gt")
            Response.Write("&ltTD&gt" & rs.Fields("hire_date").value & "&lt/TD&gt")
            Response.Write("&lt/TR&gt")
            rs.MoveNext
    wend
    Response.Write("&lt/TABLE&gt&ltBR/&gt")
	
    oConnection.Close
    set oConnection = nothing
%&gt
PS: Recordset also works. Only hanging problem is 'SET NULL'. Currently I worked around by providing empty defaults.
I found in documentation that there is DBPROP_VFPOLEDB_NULL and I could query 'set' with a dummy select. I couldn't understand how to set it though.

Thanks again to all of you.
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
Reply
Map
View

Click here to load this message in the networking platform