Consulta sql para insertar registro
Publicado por kiwa (9 intervenciones) el 06/06/2002 22:26:04
Fijate lo que intento hacer es q del Formulario que tengo en pantalla que es de la tabla datos me cree un registro en la tabla Factura con algunos de los campos del formulario que tengo en pantalla que es como te dije de la tabla datos
Te agradezco q me ayudes
me da error
Dim sSQL As String
Dim ws As Workspace
Dim db As Database
Dim rs As Recordset
sSQL = "INSERT INTO factura[(Id Factura [,Datos[,fecha Factura[,factura])]]]_& VALUES (txtFields(0).text[,txtFields(1).text[,txtFields(2).text[,txtFields(3).text ])"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\WINDOWS\Escritorio\Db1.mdb")
Set rs = db.OpenRecordset(sSQL, dbOpenTable)
With rs
If .RecordCount > 0 Then
.MoveFirst
' "" Start fields code here
'"" End Field code here
End If
End With
rs.Close
Set rs = Nothing
End Sub
Te agradezco q me ayudes
me da error
Dim sSQL As String
Dim ws As Workspace
Dim db As Database
Dim rs As Recordset
sSQL = "INSERT INTO factura[(Id Factura [,Datos[,fecha Factura[,factura])]]]_& VALUES (txtFields(0).text[,txtFields(1).text[,txtFields(2).text[,txtFields(3).text ])"
Set ws = DBEngine.Workspaces(0)
Set db = ws.OpenDatabase("C:\WINDOWS\Escritorio\Db1.mdb")
Set rs = db.OpenRecordset(sSQL, dbOpenTable)
With rs
If .RecordCount > 0 Then
.MoveFirst
' "" Start fields code here
'"" End Field code here
End If
End With
rs.Close
Set rs = Nothing
End Sub
Valora esta pregunta


0