J
jblaze
Hi. I am creating an asp.net form page that my customer service reps
can use to use on follow up calls to our customers.
Essentially, the reps will answer yes/no questions in a drop-down list
or checkbox format along with adding comments. I would like this to
write into either a Access or SQL Server database.
The problem that I am having is that when I preview the page, using
ASP.NET web matrix it works, however when I publish the site on IIS 6
it does not.
Here is what i have so far.
Sub Page_Load(sender As Object, e As EventArgs)
If Page.IsPostBack Then
InsertRecord()
End If
End Sub
Sub InsertRecord()
Dim conclasf As OleDbConnection
Dim cmdClasf As New OleDbCommand
Dim strClasf As String
Dim strSQL As String
Dim intRowsAff As Integer
lblErrMsg.Text = ""
lblRecsAff.Text = ""
strClasf = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data
Source=\\IPADDRESS\access\MIS\dbCustomerService.mdb"
conClasf = New OleDbConnection(strClasf)
conClasf.Open
strSQL = "INSERT INTO DeliveryQuestionnaire
([CustomerCode],[TruckNumber],[ProperDress],[Cautious],[SpecialDelivery],
[Comments]) values ('" & CustomerCode.Value & "', " &
TruckNumber.Value &", " & ProperDress.SelectedItem.Text &", " &
Cautious.SelectedItem.Text & ", " & SpecialDelivery.SelectedItem.Text
&", '" & Comments.Text &"')"
cmdClasf = New OleDbCommand(strSQL, conClasf)
Try
intRowsAff = cmdClasf.ExecuteNonQuery()
Catch ex As Exception
lblErrMsg.Text = ex.Message
End Try
lblRecsAff.Text = intRowsAff & " record(s) inserted using " &
strSQL
conClasf.Close
End Sub
can use to use on follow up calls to our customers.
Essentially, the reps will answer yes/no questions in a drop-down list
or checkbox format along with adding comments. I would like this to
write into either a Access or SQL Server database.
The problem that I am having is that when I preview the page, using
ASP.NET web matrix it works, however when I publish the site on IIS 6
it does not.
Here is what i have so far.
Sub Page_Load(sender As Object, e As EventArgs)
If Page.IsPostBack Then
InsertRecord()
End If
End Sub
Sub InsertRecord()
Dim conclasf As OleDbConnection
Dim cmdClasf As New OleDbCommand
Dim strClasf As String
Dim strSQL As String
Dim intRowsAff As Integer
lblErrMsg.Text = ""
lblRecsAff.Text = ""
strClasf = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data
Source=\\IPADDRESS\access\MIS\dbCustomerService.mdb"
conClasf = New OleDbConnection(strClasf)
conClasf.Open
strSQL = "INSERT INTO DeliveryQuestionnaire
([CustomerCode],[TruckNumber],[ProperDress],[Cautious],[SpecialDelivery],
[Comments]) values ('" & CustomerCode.Value & "', " &
TruckNumber.Value &", " & ProperDress.SelectedItem.Text &", " &
Cautious.SelectedItem.Text & ", " & SpecialDelivery.SelectedItem.Text
&", '" & Comments.Text &"')"
cmdClasf = New OleDbCommand(strSQL, conClasf)
Try
intRowsAff = cmdClasf.ExecuteNonQuery()
Catch ex As Exception
lblErrMsg.Text = ex.Message
End Try
lblRecsAff.Text = intRowsAff & " record(s) inserted using " &
strSQL
conClasf.Close
End Sub