Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Dim directory as string

dim cnn as new adodb.connection

dim rs as new adodb.recordset

 

Set cnn = New ADODB.Connection

Set rs = New ADODB.Recordset

 

directory = "C:\Database"

cnn.Open "Driver={Microsoft Visual FoxPro Driver}; SourceType=DBF;" & _

"SourceDB=" & directory & "; Exclusive=No;"

 

rs.Open "DB.dbf", cnn, adOpenStatic, adLockPessimistic, adcmdtable

 

'(or if you want to use SQL instruction...)

dim sql as string

sql = "SELECT * FROM DB"

 

rs.Open SQL, cnn, adOpenStatic, adLockPessimistic

 

E é só isto o que é preciso para conectar através do VB com uma base de dados FOXPRO, mas só se consegue isto se tiveres o FoxPro instalado na máquina.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...