473,395 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Trouble setting value of integer parameter for Insert Statement

Hi:

I'm trying to add a parmater of OleDbType SmallInt. It supposed to map to
int16, so I do the following:

OleDbParameter* pP2 = new OleDbParameter(S"FK_tblRaces",
OleDbType::SmallInt, 0);
pP2->Value = Int16(5); // 5 is value
this->oleDbInsertCommand1->Parameters->Add(pP2);

It bombs because not object*. How do you get object* of Int16?

Thanx,
Charlie
Nov 16 '05 #1
1 984
> It bombs because not object*. How do you get object* of Int16?

You box it...

Int16 nValue = 0;
Object *pObject = __box(nValue);
/Andreas
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
10
by: Resant | last post by:
I have a query : Exec 'Select * From Receiving Where Code In (' + @pCode + ')' @pCode will contain more than one string parameter, eg : A1, A2, A3 How can i write that parameters, I try use :...
4
by: Driesen via SQLMonster.com | last post by:
Hi guys I having trouble with this sproc. I get the following error when testing: Server: Msg 245, Level 16, State 1, Procedure UTL_CompletenessCheckLoan, Line 231 Syntax error converting the...
1
by: Niggy | last post by:
When setting parameters, I get the error: System.IndexOutOfRangeException: Invalid index -1 With Me.MySqlCommand1 .Parameters("@FileName").Value = sFileName .ExecuteNonQuery() End With
1
by: akg250978 | last post by:
ok here is my problem i created the JS to insert rows in an html doc, this works perfectly but if i was to refresh the page or leave it and return to it L8 the rows have diappeared here is the...
2
by: Robert Dufour | last post by:
I have a sub to update a record in a sql server 2000 table. There's a field FK, which is defined to allow nulls in the table definition, the field type is integer. How do I write the sub's...
1
by: =?Utf-8?B?QmlzaG95?= | last post by:
Hi all, I have an asp.net 2.0 web site with a DetailsView control to select and insert data from database. I made the insert statement for that DetailsView by a stored procedure. I made some...
1
by: Giordano | last post by:
I am trying to construct a report menu that will allow the user to select any combination of 3 variables from 3 combo boxes (Select Subject/SelectCategory/Date Range). There are 2 possible options...
5
matheussousuke
by: matheussousuke | last post by:
Hello, I'm using tiny MCE plugin on my oscommerce and it is inserting my website URL when I use insert image function in the emails. The goal is: Make it send the email with the URL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...
0
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...

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.