1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Dim conn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Try
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=H:\Projects\ImmoInfo\ImmoInfo\Immohb.mdb"
conn.Open()
cmd.Connection = conn
cmd.CommandText = "insert into tb1 (tb_id,tb_title,tb_prix,tb_content,tb_category,tb_postal,tb_provinces,tb_adresse,tb_ville,tb_pays,tb_surfhab,tb_etage,tb_chambre,tb_facade,tb_garage,tb_libre,tb_viabilisé,tb_jardin,tb_chauffage) values('" + tb_id.Text + "','" + tb_title.Text + "','" + tb_prix.Text + "','" + tb_content.Text + "','" + type.Text + "','" + tb_postal.Text + "','" + tb_provinces.Text + "','" + tb_adresse.Text + "','" + tb_ville.Text + "','" + tb_pays.Text + "','" + tb_surfhab.Text + "','" + tb_etage.Text + "','" + tb_chambre.Text + "','" + tb_facade.Text + "','" + tb_garage.Text + "','" + tb_libre.Text + "','" + tb_viabilisé.Text + "','" + tb_jardin.Text + "','" + tb_chauffage.Text + "')"
cmd.CommandText = "insert into img (imgid,img1,img2,img3,img4,img5,img6,img7,img8) values ('" + tb_id.Text + "','pb1.Image','pb2.Image','pb3.Image','pb4.Image','pb5.Image','pb6.Image','pb7.Image','pb8.Image')"
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message + "NON EXECUTE !!")
If conn IsNot Nothing Then
conn.Close()
End If
End Try |