DBF via ADO

DBF via ADO

Postby lailton.webmaster » Tue Oct 06, 2009 6:08 am

Is possible use DBF via ADO ? and use command SQL.

if yes, can show a sample please :?:

thanks so much.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: DBF via ADO

Postby anserkk » Tue Oct 06, 2009 7:07 am

I beleive that you can open DBF files via ADO

Assuming your DBF files exists on C:\
Code: Select all  Expand view
oConn:= CreateObject("ADODB.Connection")
oConn:Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\;Extended Properties=DBASE IV"

cSQL = "SELECT * FROM HPCLAIM WHERE Peril='WTR' AND Incurred >= 50000 AND Incurred <= 100000"

rsClaims = CreateObject("ADODB.Recordset")
rsClaims:CursorLocation = 3  // adUseClient
rsClaims:CursorType = 3 // adOpenStatic
rsClaims:ActiveConnection:= oConn
rsClaims:Open cSQL


You can use any ODBC statement (Create table, Insert Into, Delete, Select ...). You can address the table using several ways:

Select * from Persons
Select * from Persons.DBF
Insert Into Persons#DBF Values (...)
Delete * from [Persons.DBF] Where ...

Create Table [Any Long File Name You Want] As ...

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: DBF via ADO

Postby lailton.webmaster » Tue Oct 06, 2009 3:44 pm

Perfect.
Last edited by lailton.webmaster on Tue Oct 06, 2009 4:00 pm, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: DBF via ADO

Postby sygecom » Tue Oct 06, 2009 3:56 pm

Tire o .DBF que deve funcionar ! Eu uso sem informar as extensão.
User avatar
sygecom
 
Posts: 51
Joined: Tue Mar 11, 2008 3:18 am
Location: Brasil

Re: DBF via ADO

Postby lailton.webmaster » Tue Oct 06, 2009 4:00 pm

blz funcionou legal,

obrigado.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 68 guests