Visual Foxpro string sql in DBF

Visual Foxpro string sql in DBF

Postby ronaldo » Sat Jul 09, 2011 7:47 pm

I am using the Microsoft Visual Foxpro library, it is possible to open DBF using SQL string I put it in cool ADORDD

ps. the opening speed and filter is super fast

Ronaldo Minacapelli
[b]Ronaldo Minacapelli[/b]
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
User avatar
ronaldo
 
Posts: 139
Joined: Fri Nov 25, 2005 4:38 pm
Location: brasil

Re: Visual Foxpro string sql in DBF

Postby nageswaragunupudi » Sat Jul 09, 2011 7:53 pm

It is possible to open DBF files with ADO on any Windows PC and I use this for some complex SQL queries.

But may I know if Visual FoxPro library is different and its additional advantages?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Visual Foxpro string sql in DBF

Postby nageswaragunupudi » Sat Jul 09, 2011 8:19 pm

I have seen the link you posted in the Spanish forums and I downloaded the vfpoledb. It is working well. Thanks for the info.

I am using the connection string:
'Provider=vfpoledb;Data Source=<mydatapath>;Collating Sequence=general;'
and this is working.

Do you suggest any different connection string?
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10646
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Visual Foxpro string sql in DBF

Postby ronaldo » Tue Jul 12, 2011 11:35 pm

see example,

try
oRs := CreateObject("ADODB.RecordSet")
oRs:CursorLocation := adUseClient
oRs:LockType := adLockOptimistic
oRs:CursorType := adOpenDynamic
oRs:ActiveConnection := "Provider=VFPOLEDB.1;Data Source="+Curdrive()+":\"+Curdir()+";Mode=Read;Extended Properties=DBASE IV"
catch
oDlg:Refresh()
If MsgYesno("Erro no acesso ao OLEDB Visual FoxPro, deseja baixa-lo agora? ","Drive VFP")
ShellExecute( 0, "open", "http://www.bazevani.com.br/atualizacao/VFPOLEDBSetup.msi" )
Else
oDlg:Refresh()
MsgStop("Operação cancelada, necessário a instalação do drive: OLEDB Visual FoxPro","Erro !")
Endif

oDlg:Refresh()
return(.T.)

end



try
oRs:Source := cSQL1
oRs:Open()
catch
oDlg:Refresh()
MsgStop("Operação cancelada, ocorreu alguem problema na leitura do arquivo internet.dbf","Erro !")
oDlg:Refresh()
return(.T.)
end

While .NOT. oRs:Eof

nNro := oRs:Fields("Imovel"):value
[b]Ronaldo Minacapelli[/b]
Sistemas, Hospedagem e Criação de WebSites
http://www.bazevani.com.br
User avatar
ronaldo
 
Posts: 139
Joined: Fri Nov 25, 2005 4:38 pm
Location: brasil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 101 guests