473,699 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OLE prob - Must declare the variable '@Title'.

27 New Member
I'm having a problem with updating a record through a form.

Here is the error:

[HTML]Server Error in '/AccoEndUser' Application.
--------------------------------------------------------------------------------

Must declare the variable '@Title'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Ole Db.OleDbExcepti on: Must declare the variable '@Title'.

Source Error:


Line 202: objConn.open()
Line 203:
Line 204: objCmd.ExecuteN onQuery()
Line 205:
Line 206: objConn.close()[/HTML]

And here is my code:

[HTML]<!-- #include file="includes/acco_inc.aspx"-->
<%@ import namespace="Syst em.Data" %>
<%@ import namespace="Syst em.Data.OleDb" %>
<Script Language="VB" Runat="Server">



dim objCmd As OleDbCommand
dim objRdr As OleDbDataReader
dim strCmd As String

sub UpdateRec(s As Object, e As EventArgs)

dim dsn As String = ConfigurationSe ttings.AppSetti ngs("SystemConn ection")

dim objConn as New OleDbConnection (dsn)

objCmd = New OleDbCommand("U PDATE tbl_ACCO_EU_Con tacts SET Title=@Title, FirstName=@Firs tName, LastName=@LastN ame, CompanyPosition =@CompanyPositi on, CompanyName=@Co mpanyName, CompanyAddress1 =@CompanyAddres s1, CompanyAddress2 =@CompanyAddres s2, CompanyAddress3 =@CompanyAddres s3, CompanyAddress4 =@CompanyAddres s4, CompanyTown=@Co mpanyTown, CompanyCounty=@ CompanyCounty, CompanyPostcode =@CompanyPostco de, CompanyEMailAdd ress=@CompanyEM ailAddress, CompanyTelephon e=@CompanyTelep hone, CompanyFax=@Com panyFax, CompanyDirectDi al=@CompanyDire ctDial, CompanyWebAddre ss=@CompanyWebA ddress, CompanySIC=@Com panySIC, CompanySize=@Co mpanySize, PersonalAddress 1=@PersonalAddr ess1, PersonalAddress 3=@PersonalAddr ess3, PersonalAddress 4=@PersonalAddr ess4, PersonalTown=@P ersonalTown, PersonalCounty= @PersonalCounty , PersonalPostCod e=@PersonalPost Code, PersonalCountry =@PersonalCount ry WHRER EndUserID=@EndU serID" , objConn )

objCmd.Paramete rs.Add("@Title" , textTitle.Text)
objCmd.Paramete rs.Add("@FirstN ame", textFirstName.T ext)
objCmd.Paramete rs.Add("@LastNa me", textLastName.Te xt)
objCmd.Paramete rs.Add("@Compan yPosition", textCompanyPosi tion.Text)
objCmd.Paramete rs.Add("@Compan yName", textCompanyName .Text)
objCmd.Paramete rs.Add("@Compan yAddress1", textCompanyAddr ess1.Text)
objCmd.Paramete rs.Add("@Compan yAddress2", textCompanyAddr ess2.Text)
objCmd.Paramete rs.Add("@Compan yAddress3", textCompanyAddr ess3.Text)
objCmd.Paramete rs.Add("@Compan yAddress4", textCompanyAddr ess4.Text)
objCmd.Paramete rs.Add("@Compan yTown", textCompanyTown .Text)
objCmd.Paramete rs.Add("@Compan yCounty", textCompanyCoun ty.Text)
objCmd.Paramete rs.Add("@Compan yPostcode", textCompanyPost code.Text)
objCmd.Paramete rs.Add("@Compan yEMailAddress", textCompanyEMai lAddress.Text)
objCmd.Paramete rs.Add("@Compan yTelephone", textCompanyTele phone.Text)
objCmd.Paramete rs.Add("@Compan yFax", textCompanyFax. Text)
objCmd.Paramete rs.Add("@Compan yDirectDial", textCompanyDire ctDial.Text)
objCmd.Paramete rs.Add("@Compan yWebAddress", textCompanyWebA ddress.Text)
objCmd.Paramete rs.Add("@Compan ySIC", textCompanySIC. Text)
objCmd.Paramete rs.Add("@Compan ySize", textCompanySize .Text)
objCmd.Paramete rs.Add("@Person alAddress1", textPersonalAdd ress1.Text)
objCmd.Paramete rs.Add("@Person alAddress2", textPersonalAdd ress2.Text)
objCmd.Paramete rs.Add("@Person alAddress3", textPersonalAdd ress3.Text)
objCmd.Paramete rs.Add("@Person alAddress4", textPersonalAdd ress4.Text)
objCmd.Paramete rs.Add("@Person alTown", textPersonalTow n.Text)
objCmd.Paramete rs.Add("@Person alCounty", textPersonalCou nty.Text)
objCmd.Paramete rs.Add("@Person alPostCode", textPersonalPos tCode.Text)

objConn.open()

objCmd.ExecuteN onQuery()

objConn.close()

end sub

</script>[/HTML]

Any ideas would be great.

Cheers

Adz
Sep 3 '07 #1
1 2868
Shashi Sadasivan
1,435 Recognized Expert Top Contributor
I have worked with odbc, not oleDb...but they should be similar..
i Sensed a few lines of code missing.

Please check this forum...
http://forums.devx.com/showthread.php?t=152870

Cheers
Sep 3 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2076
by: Halfdan Holger Knudsen | last post by:
goodday all - here's a snippet of code that just doesn't seem to work...at all! But I haven't got the faintest idea why I keep getting an unref. local var. error. Take a look - I know I can get good help here. And PS: Thanks beforehand. If you're wondering - it's an attempt at a (crude) reproduction of the string.split() functionality for learning purposes. ---------------------- #! /usr/bin/env python
1
4771
by: Bill S. | last post by:
Hi, I a stored procedure that inserts a record into a table as below. The insert works OK, but if the insert violates a unique indewx constraint on one of the columns, the proc terminates immediately, and does NOT execute the 'if @@ERROR <> 0' statement.
29
5731
by: Thomas | last post by:
Hi I have an XSL stylesheet: <xsl:for-each select="TRACKS/TRACK"> <tr class="TDL"> <td width="90%"><xsl:number value="position()" format="1" /> - <xsl:value-of select="TRACKTITLE"/></td> <td width="10%" align="center"><a href="{TRACKURL}" target="_blank">More info!</a></td>
6
19055
by: rick | last post by:
Noob problem. I prefer to keep all my scripts in an external '.js' file. I am currently loading the external '.js' file from the header. Problem is I would like to declare a global variable in the external file, but I keep getting an error about the object does not exist. Can someone tell me where or how to declare a global variable in an external file that is available after the page is loaded.
6
3689
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input element using createElement(), but when I go to append the form element into the new document, the script halts and I get the following error in my Javascript Console (Firefox 1.0): __tmp_newDoc.body has no properties.
6
2440
by: JyotiC | last post by:
hi, i am making a GUI using Tkinter, I have a button and a checkbutton. i want the button to be enable when checkbutton is on and disble when the checkbutton is off. thanx
2
2082
by: andrewanderson | last post by:
hi can anyone help me with this prog. cant find the prob why it cant display cout<<"This is the display of your transaction"<<endl; ifstream fobj; //declare input file stream fobj.open("trans.txt"); //open file if(!fobj) //File not opened
1
2781
by: ares.lagae | last post by:
- I have a typelist and I want to declare a member variable for each of the types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to declare member variables with type "int" and "float". - I have a typelist and I want to declare a variable based on each of the types types. How can I do that? E.g. I have the typelist "typedef boost::mpl::vector<int, float> types;" and I want to...
15
1482
by: the consiglieri | last post by:
hello there .. im not much an expert in C....im trying to use int** for reperesentation of matrices(as double subscripted arrays .)but at run time an error occurs ..saying ...general exception error ...processor fault ....im using TURBO C v4.5 so plzif any body could help me
0
8613
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9172
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8908
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5869
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2344
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.