ayuda con base de datos
Publicado por roman (1 intervención) el 09/10/2007 23:55:18
Hola amigos, tengo un formulario el cual deceo que sea guardado en una base de datos , tengo el siguiente codigo pero me da un error en el open no se porque sera , les dejo el codigo , bueno gracias
Dim cnn As New ADODB.Connection
Private Sub Command1_Click()
Dim strsql As String
strsql = "INSERT INTO Base (Nombre,Apellido,Cedula,Direccion, Ciudad, Departamento, Pais, user_name, contraseña) SELECT '" & Text1.Text & _
"','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "'"
cnn.Execute (strsql)
End
End Sub
Private Sub Form_Load()
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source").Value = "G:\Nueva Carpeta\Base.mdb"
.Properties("User ID").Value = "x"
.Properties("Jet OLEDB:System Database").Value = ""
.Properties("Password").Value = ""
.Open
End With
End Sub
Dim cnn As New ADODB.Connection
Private Sub Command1_Click()
Dim strsql As String
strsql = "INSERT INTO Base (Nombre,Apellido,Cedula,Direccion, Ciudad, Departamento, Pais, user_name, contraseña) SELECT '" & Text1.Text & _
"','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "'"
cnn.Execute (strsql)
End
End Sub
Private Sub Form_Load()
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source").Value = "G:\Nueva Carpeta\Base.mdb"
.Properties("User ID").Value = "x"
.Properties("Jet OLEDB:System Database").Value = ""
.Properties("Password").Value = ""
.Open
End With
End Sub
Valora esta pregunta


0