DBF via ADO

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

DBF via ADO

Post by lailton.webmaster »

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

if yes, can show a sample please :?:

thanks so much.
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: DBF via ADO

Post by anserkk »

I beleive that you can open DBF files via ADO

Assuming your DBF files exists on C:\

Code: Select all

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
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: DBF via ADO

Post by lailton.webmaster »

Perfect.
Last edited by lailton.webmaster on Tue Oct 06, 2009 4:00 pm, edited 1 time in total.
User avatar
sygecom
Posts: 42
Joined: Tue Mar 11, 2008 3:18 am
Location: Brasil

Re: DBF via ADO

Post by sygecom »

Tire o .DBF que deve funcionar ! Eu uso sem informar as extensão.
lailton.webmaster
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: DBF via ADO

Post by lailton.webmaster »

blz funcionou legal,

obrigado.
Post Reply