Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

No Hair left to pull so time for a last ditch effort here....

Thread Tools
 
Search this Thread
 
Old 15 July 2002, 09:37 AM
  #1  
Dizzy
Scooby Regular
Thread Starter
 
Dizzy's Avatar
 
Join Date: May 2001
Posts: 2,537
Likes: 0
Received 0 Likes on 0 Posts
Unhappy

Please help.. I've just about lost patients with this now. I've hunted for examples in google back can't get the ADO object to send data to a MEMO / TEXT field

=============================================
// I set up the parameter here....
pParam8 = pCmd->CreateParameter("Param8", adLongVarChar, adParamInput,16, nValue="");

hr = pParameters->Append(pParam8);

//Set it with some data
COleVariant strVar="aewfaewf wafe ae f";
pParam8->AppendChunk(strVar);

//And tell the pile o cack to do stuff (or atleast try too)
pRset=pCmd->Execute(&vRowsAffected, &vNull, adCmdText);
=============================================


and this is what I get
"Application uses a value of the wrong type for the current operation."
Old 15 July 2002, 02:52 PM
  #2  
Dizzy
Scooby Regular
Thread Starter
 
Dizzy's Avatar
 
Join Date: May 2001
Posts: 2,537
Likes: 0
Received 0 Likes on 0 Posts
Unhappy

ah well 65 reads n no replies :'(

I've made some progress now but now the Execute command just crashes no exception .

Any ideas ?

//The correct prarameter creation
pParam8 = pCmd->CreateParameter("Param8", adLongVarChar, adParamInput,2147483647, nValue="test");

// I now have to make a byte safe array to insert the data

pParam8->AppendChunk(strVar);

//This causes an access violation in SQLOLEDB
pCmd->Execute(NULL,NULL, adCmdText);
Old 15 July 2002, 03:00 PM
  #3  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Unhappy

Sorry m8, but I'm sure all 65 of us who viewed it are just like me and don't have a fecking scooby

Stefan
Old 15 July 2002, 04:15 PM
  #4  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

Dizzy,

Sorry didnt catch the last thread, why are using a variant array?
Im guessing you're using C++ builder and SQL Server? Im assuming you've tried using a normal adVarChar type and do a simple string value assignment.

Im busting my b*lls with work at the mo, but in a couple of days may be able t look (if its C++ it easy to port to my dev. tool of choice: Delphi) to take a look.

Cheers

Gary
Old 15 July 2002, 04:52 PM
  #5  
Dizzy
Scooby Regular
Thread Starter
 
Dizzy's Avatar
 
Join Date: May 2001
Posts: 2,537
Likes: 0
Received 0 Likes on 0 Posts
Post

cheers...
I'm having to convert to a Safe array as its inserting into a MEMO field (or TEXT in SQL Server) If you dont you just get a crappy "Bad Data type" or some such tripe. I always write in VC++ and if the need arrises <shudder> VB </shudder>

Infact I may actually try it in VB now
Old 15 July 2002, 05:23 PM
  #6  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

What happened when you set the datatype to varchar in SQLServer?

Ahh see you should use C++Builder: gives you the power VC++ and gives you the ease of VB. God yeah VB, I would rather get a job outside IT than use VB to write software, it sucks!

Gary
Old 16 July 2002, 11:31 AM
  #7  
Dizzy
Scooby Regular
Thread Starter
 
Dizzy's Avatar
 
Join Date: May 2001
Posts: 2,537
Likes: 0
Received 0 Likes on 0 Posts
Post

ok all I can say is

O M F G

1) It just bombs in 2000
2) I just tried it on NT and got a "Catastrophic Failure"!! Finaly and Error msg!

I hunted around and it turns out its a Smeggin DRIVER BUG!!! it loads the Winmm.dll in the wrong order and causes a crash [img]images/smilies/mad.gif[/img] All i had to do was try it on access [img]images/smilies/mad.gif[/img][img]images/smilies/mad.gif[/img][img]images/smilies/mad.gif[/img][img]images/smilies/mad.gif[/img]
Old 16 July 2002, 12:37 PM
  #8  
GaryK
Scooby Regular
 
GaryK's Avatar
 
Join Date: Sep 1999
Location: Bedfordshire
Posts: 4,037
Likes: 0
Received 0 Likes on 0 Posts
Post

Dizzy,

What version of MDAC did you install? O well at least you solved the problem anyway!

Gary
Old 16 July 2002, 03:50 PM
  #9  
Dizzy
Scooby Regular
Thread Starter
 
Dizzy's Avatar
 
Join Date: May 2001
Posts: 2,537
Likes: 0
Received 0 Likes on 0 Posts
Post

I've completely finished now

I run Win2k which doesn't use "MDAC" installations as they come within service packs...

I still can't understand why they havn't fixed it when they claim it shouldn't happen though ADO I suppose I could contact there "support" and pay them for the priverlage of hearing "yes, we know"
Old 16 July 2002, 04:59 PM
  #10  
jjones
Scooby Regular
 
jjones's Avatar
 
Join Date: Apr 1999
Posts: 4,410
Received 1 Like on 1 Post
Post



[Edited by jjones - 7/16/2002 5:14:33 PM]
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
30 January 2024 01:27 PM
SilverM3
ScoobyNet General
8
24 February 2021 01:03 PM
alcazar
Non Scooby Related
37
27 September 2015 10:35 PM
StueyBII
General Technical
4
26 September 2015 12:35 PM
StueyBII
General Technical
0
25 September 2015 05:58 PM



Quick Reply: No Hair left to pull so time for a last ditch effort here....



All times are GMT +1. The time now is 04:40 AM.