I am trying to get my .net program to update to a mdb. I cant get my insert or select statments to work properly. I am sending some of the code so maybe you guys can see my problem. Thanks.
Dim conIncident As OleDbConnection
Dim strIncident As String
Dim strComplaintant As String
Dim strSuspect As String
Dim strNarrative As String
Dim cmdIncident As OleDbCommand
Dim cmdComplaintant As OleDbCommand
Dim cmdSuspect As OleDbCommand
Dim cmdNarrative As OleDbCommand
conIncident = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\Incident.mdb"
strIncident = "Insert Into tb_IncidentTicket ( pk_ReportNumber, DateOccured, TimeOccured, DateReported, TimeReported, Wats, XCoordinate, YCoordinate, CodeNumber, County, District, ReportingMethod, CompletedDate, TypeIncident, location, _GPSZone, Datum ) Values ( @pk_ReportNumber, @DateOccured, @TimeOccured, @DateReported, @TimeReported, @Wats, @XCoordinate, @YCoordinate, @CodeNumber, @County, @District, @ReportingMethod, @DateRecieved, @TypeIncident, @Location, @GPSZone, @Datum)"
cmdIncident = New OleDbCommand(strIncident, conIncident)
cmdIncident.Parameters.Add("@pk_ReportNumber", txtReportNumber.Text)
cmdIncident.Parameters.Add("@DateOccured", txtDateOccured.Text)
cmdIncident.Parameters.Add("@TimeOccured", txtTimeOccured.Text)
cmdIncident.Parameters.Add("@DateReported", txtDateReported.Text)
cmdIncident.Parameters.Add("@TimeReported", txtTimeReported.Text)
cmdIncident.Parameters.Add("@Wats", txtWats.Text)
cmdIncident.Parameters.Add("@XCoordinate", txtXCoord.Text)
cmdIncident.Parameters.Add("@YCoordinate", txtYCoord.Text)
cmdIncident.Parameters.Add("@CodeNumber", txtCodeNumber.Text)
cmdIncident.Parameters.Add("@County", cmbCounty.Text)
cmdIncident.Parameters.Add("@District", cmbDistrict.Text)
cmdIncident.Parameters.Add("@ReportingMethod", cmbReported.Text)
cmdIncident.Parameters.Add("@TypeIncident", cmdTypeIncident.Text)
cmdIncident.Parameters.Add("@Location", txtLocation.Text)
cmdIncident.Parameters.Add("@GPSZone", txtZone.Text)
cmdIncident.Parameters.Add("@Datum", cmdDatum.Text)
conIncident.Open()
cmdIncident.ExecuteNonQuery()
conIncident.Close()
Dim conIncident As OleDbConnection
Dim strIncident As String
Dim strComplaintant As String
Dim strSuspect As String
Dim strNarrative As String
Dim cmdIncident As OleDbCommand
Dim cmdComplaintant As OleDbCommand
Dim cmdSuspect As OleDbCommand
Dim cmdNarrative As OleDbCommand
conIncident = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA Source=c:\Incident.mdb"
strIncident = "Insert Into tb_IncidentTicket ( pk_ReportNumber, DateOccured, TimeOccured, DateReported, TimeReported, Wats, XCoordinate, YCoordinate, CodeNumber, County, District, ReportingMethod, CompletedDate, TypeIncident, location, _GPSZone, Datum ) Values ( @pk_ReportNumber, @DateOccured, @TimeOccured, @DateReported, @TimeReported, @Wats, @XCoordinate, @YCoordinate, @CodeNumber, @County, @District, @ReportingMethod, @DateRecieved, @TypeIncident, @Location, @GPSZone, @Datum)"
cmdIncident = New OleDbCommand(strIncident, conIncident)
cmdIncident.Parameters.Add("@pk_ReportNumber", txtReportNumber.Text)
cmdIncident.Parameters.Add("@DateOccured", txtDateOccured.Text)
cmdIncident.Parameters.Add("@TimeOccured", txtTimeOccured.Text)
cmdIncident.Parameters.Add("@DateReported", txtDateReported.Text)
cmdIncident.Parameters.Add("@TimeReported", txtTimeReported.Text)
cmdIncident.Parameters.Add("@Wats", txtWats.Text)
cmdIncident.Parameters.Add("@XCoordinate", txtXCoord.Text)
cmdIncident.Parameters.Add("@YCoordinate", txtYCoord.Text)
cmdIncident.Parameters.Add("@CodeNumber", txtCodeNumber.Text)
cmdIncident.Parameters.Add("@County", cmbCounty.Text)
cmdIncident.Parameters.Add("@District", cmbDistrict.Text)
cmdIncident.Parameters.Add("@ReportingMethod", cmbReported.Text)
cmdIncident.Parameters.Add("@TypeIncident", cmdTypeIncident.Text)
cmdIncident.Parameters.Add("@Location", txtLocation.Text)
cmdIncident.Parameters.Add("@GPSZone", txtZone.Text)
cmdIncident.Parameters.Add("@Datum", cmdDatum.Text)
conIncident.Open()
cmdIncident.ExecuteNonQuery()
conIncident.Close()