coneccion con visual fox pro
Publicado por sergio flores (1 intervención) el 13/03/2003 00:06:36
HOLA!!
HE LEIDO VUESTRO EMAIL Y APELO A VUESTRA EXPERIENCIA ENTRE FOX Y VISUAL BASIC
ESTOY CONFECCIONADO UN PROGRAMA EN VISUAL Y DEBO CONECTARME A VISUAL FOX. LA CONECCION FUNCIONA DENTRO DE UN SOLO DIRECTORIO PERO NO SE COMO HACERLO PARA TABLAS QUE ESTAN EN DIFERENTES DIRECTORIOS ESPERO VUESTRA AYUDA
SIN OTRO PARTICULAR
SERGIO FLORES FLORES
TE AJDUNTO UN EJEMPLO.
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
mirut = Val(Text1.Text)
If Val(Text1.Text) < 0 Then
mens = MsgBox("Debe ingresar Rut de Empresa ", vbOKOnly, "Error")
Text1.SetFocus
Else
Dim cnfox As ADODB.Connection, rsfox As ADODB.Recordset
'abro la base de datos de fox
Set cnfox = New ADODB.Connection
cnfox.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties=Driver={Microsoft Visual FoxPro Driver};UID=;SourceDB=" & App.Path & "\;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
cnfox.Open
'abro el recordset de fox
Set rsfox = New ADODB.Recordset
rsfox.CursorLocation = adUseClient
'me aseguro de que esté vacío, para ahorrar tiempo
rsfox.Open "select * from maeprov where prorut = " & mirut & "", cnfox, adOpenKeyset, adLockOptimistic
Call limpia
...
Valora esta pregunta


0