stored procedure adVarBinary

msmeth
11-05-2004, 11:01 AM
I've got to use a stored procedure and it requires an input parameter for a "Notes" fields that is of type adVarBinary. I'm passing the values in thru VB6. I need to pass what's in a textbox into that parameter but I'm getting an error that says "[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid text, ntext, or image pointer value..."

If I just pass in Null, its fine but I need to pass in text. This is the code I use:


cmd.Parameters.Append cmd.CreateParameter("p_cNOTES_in", adVarBinary, adParamInput, 16, txtNotes)


what do I need to do for this sort of parameter?

Dennis DVR
11-05-2004, 11:33 AM
If the txtNotes isn't that long, then use varchar datatypes. If it's large, then why don't you save it as file instead of storing it as text,ntext,image?

btw: what version of SQL Server you are using?

msmeth
11-05-2004, 12:03 PM
if the txtNotes isn't that long, then use varchar datatypes. Anyway what is the datatype of your p_cNOTES field?

btw: what version of SQL Server you are using?

The datatype of the Notes field in the table is Text with length 16. I'm using SQL Server 6.0.

And txtNotes isn't that long....right now it holds the word "Test" in it but it should be fairly long because it is a notes field.....In any case, I can't change the datatype in the stored procedure....I'm using one that came with the database our company uses and I can't change it.

Dennis DVR
11-05-2004, 12:11 PM
The datatype of the Notes field in the table is Text with length 16. I'm using SQL Server 6.0.

And txtNotes isn't that long....right now it holds the word "Test" in it but it should be fairly long because it is a notes field.....In any case, I can't change the datatype in the stored procedure....I'm using one that came with the database our company uses and I can't change it.

can we see your stored procedure for saving the text field?

msmeth
11-05-2004, 12:17 PM
can we see your stored procedure for saving the text field?

Um...no :chuckle: It's really really really long......

I can always just run a separate update query to update the notes field but that's messy and I don't like it.

Dennis DVR
11-05-2004, 12:48 PM
Um...no :chuckle: It's really really really long......

I can always just run a separate update query to update the notes field but that's messy and I don't like it.

Post the code specifically for the text field, do you have problems inserting the text field or updating?

MKoslof
11-06-2004, 09:38 AM
I don't think I have ever seen a text box being passed as a value for a VarBinary parameter. I have seen Timestamps (and implemented this myself), but I am not sure why you are trying to send a text value into this parameter definition..by default, this is going to be awkward. Can you tell me what a typical value would be for this? Such as, are you sending "Hello, my name is MSeth" to this procedure? What are some example values?

msmeth
11-08-2004, 06:10 AM
I don't think I have ever seen a text box being passed as a value for a VarBinary parameter. I have seen Timestamps (and implemented this myself), but I am not sure why you are trying to send a text value into this parameter definition..by default, this is going to be awkward. Can you tell me what a typical value would be for this? Such as, are you sending "Hello, my name is MSeth" to this procedure? What are some example values?

I have no idea why they have it set up as a VarBinary parameter. The field in the table is a Text field and its for Notes so....

An example value would be "Item needs to be ordered because all available are required for other jobs."

msmeth
11-08-2004, 06:20 AM
Post the code specifically for the text field, do you have problems inserting the text field or updating?

Nope, no problems updating the text field if I run a separate query.

MKoslof
11-13-2004, 09:20 AM
Sorry I have been away from the board this week, trying to catch up where I can....

Do you have any "working examples" for this stored procedure? As in, you say your company defined this stored procedure and you can't change the format. So, how do they expect this to work? I am actually curious :). Did they provide you with any design requirements or working examples. I don't understand why this is varBinary defined type if the values passed are simply unicode strings.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum