Advertisement

03.02.2008 at 10:10PM PST, ID: 23208575
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.9

Insert information into access database using ADO.NET

Asked by nxpsupport in .NET, VB Database Programming, VB Objects

Tags:

I am having all sorts of issues.  I think I am headed in the right direction but I get the following error:

Object reference not set to an instance of an object. (ERROR IS SHOWING ON LINE12)

Line 10:       Dim SqlStr As String = "INSERT INTO ClaimStatusRequests (clientNumber, ourNumber, statusMemo)VALUES('" & cfnconfirm.Text & "','" & ofnconfirm.Text & "','" & msgconfirm.Text & "')
Line 11:       Dim Cmd As New OleDbCommand(SqlStr,OleDbCon1)
Line 12:       OleDbCon1.Open()
Line 13:       Cmd.ExecuteNonQuery()  
Line 14:       OleDbCon1.Close()Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
HERE ARE THE EVENTS:
 
<%@ Import Namespace="System.Data.OleDb" %>
<script  runat="server">
Sub confirmit(sender As Object, e As EventArgs)
	Dim OleDbCon1 As OleDbConnection
	Dim ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=index-3.mdb"	
	Dim SqlStr As String = "INSERT INTO ClaimStatusRequests (clientNumber, ourNumber, statusMemo)VALUES('" & cfnconfirm.Text & "','" & ofnconfirm.Text & "','" & msgconfirm.Text & "')"	
	Dim Cmd As New OleDbCommand(SqlStr,OleDbCon1)
	OleDbCon1.Open()
	Cmd.ExecuteNonQuery()   
	OleDbCon1.Close()
 
End Sub
 
Sub submit(sender As Object, e As EventArgs)
   cfnconfirm.Text="" & cfn.Text
   ofnconfirm.Text="" & ofn.Text
   msgconfirm.Text="" & msg.Text
   cfn.Visible="False"
   ofn.Visible="False"
   msg.Visible="False"   
   cfnconfirm.Visible="True"
   ofnconfirm.Visible="True"
   msgconfirm.Visible="True"
   submitbutton.Visible="False"
   confirmbutton.Visible="True"
   fixbutton.Visible="True"
   formheader.Visible="False"
   confirmheader.Visible="True"
End Sub
 
Sub fixform(sender aS Object, e As EventArgs)
   cfn.Text="" & cfnconfirm.Text
   ofn.Text="" & ofnconfirm.Text
   msg.Text="" & msgconfirm.Text
   cfn.Visible="True"
   ofn.Visible="True"
   msg.Visible="True"   
   cfnconfirm.Visible="False"
   ofnconfirm.Visible="False"
   msgconfirm.Visible="False"
   submitbutton.Visible="True"
   confirmbutton.Visible="False"
   fixbutton.Visible="False"
   confirmheader.Visible="False"
   formheader.Visible="True"
End Sub
 
</script>
 
 
HERE IS MY FORM:
 
<Form name="form1" runat="server">	
	<asp:Label id="formheader" runat="server" Visible="True">Please use the form below</asp:Label>			
	<asp:Label id="confirmheader" runat="server" Visible="False">Please confirm the information below</asp:Label>
						
	<asp:RequiredFieldValidator ControlToValidate="cfn" Text="*" runat="server" />
	Client File Number:
	<asp:Label id="cfnconfirm" runat="server" Font-Size="X-Small" /> <br>
	<asp:TextBox id="cfn" runat="server"/>
				
	<asp:RequiredFieldValidator ControlToValidate="ofn" Text="*" runat="server"/>
	Our File Number:
	<asp:Label id="ofnconfirm" runat="server"/><br>
	<asp:TextBox id="ofn" runat="server"/>
							
	<asp:RequiredFieldValidator ControlToValidate="msg" Text="*" runat="server"/>
	Reason for Request:
	<asp:Label id="msgconfirm" runat="server"/>
	<asp:TextBox id="msg" runat="server" TextMode="MultiLine" Width="265px"/>
			
	<asp:Button OnClick="submit" Text="Submit" id="submitbutton" runat="server"/>				
	<asp:Button OnClick="confirmit" runat="server" Text="Confirm" id="confirmbutton" Visible="False"/>
	<asp:Button OnClick="fixform" runat="server" Text="Fix Form" id="fixbutton" Visible="False"/>
</Form>
 
Loading Advertisement...
 
[+][-]03.02.2008 at 10:59PM PST, ID: 21029452

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .NET, VB Database Programming, VB Objects
Tags: Asp.Net, VBscript
Sign Up Now!
Solution Provided By: Dhaest
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.03.2008 at 05:48AM PST, ID: 21031301

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628