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.

ADO CreateParameter on the Command object

Thread Tools
 
Search this Thread
 
Old Jul 12, 2002 | 10:58 AM
  #1  
Dizzy's Avatar
Dizzy
Thread Starter
Scooby Regular
 
Joined: May 2001
Posts: 2,537
Likes: 0
Question

I'm trying to write a parameterised query to insert data into an access memo field and I cant get the sodding thing to work (probably coz I'm hung over ) and I keep getting this error

"[Microsoft][ODBC Microsoft Access Driver]Invalid string or buffer length"

Has anyone else used Command object and care to shed some light?
Thanks in advance

e.g. :

m_pClauseCommand->CommandText = "insert into Clause(ClauseRef, ClauseCode, Title, Content, Created, Ammended ..blah blah..values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ,?,?,?,?)";
m_pClauseCommand->CommandType = adCmdText;
m_pClauseCommand->CommandTimeout = 15;

COleVariant oleDefault("");

//Add all the parameters in :/
_ParameterPtr pParam;
pParam = m_pClauseCommand->CreateParameter("ClauseRef", adChar, adParamInput,10,oleDefault);
m_pClauseCommand->Parameters->Append(pParam);
pParam = m_pClauseCommand->CreateParameter("ClauseCode", adChar, adParamInput,20,oleDefault);
m_pClauseCommand->Parameters->Append(pParam);
pParam = m_pClauseCommand->CreateParameter("Title", adChar, adParamInput,255,oleDefault);
m_pClauseCommand->Parameters->Append(pParam);
pParam = m_pClauseCommand->CreateParameter("Content", adLongVarWChar, adParamInput,4096,oleDefault);
m_pClauseCommand->Parameters->Append(pParam);
Reply
Old Jul 12, 2002 | 11:06 AM
  #2  
Dizzy's Avatar
Dizzy
Thread Starter
Scooby Regular
 
Joined: May 2001
Posts: 2,537
Likes: 0
Post

ok I think ive found it

I have to use AppendChunk for Text & memo fields thankyou google
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
alcazar
Non Scooby Related
159
Oct 5, 2015 08:37 PM
the shreksta
Other Marques
26
Oct 1, 2015 02:30 PM
mike_nunan
Wheels, Tyres & Brakes
7
Jan 16, 2014 04:22 AM
vmax
Non Scooby Related
2
Aug 24, 2001 07:53 PM
SCOSaltire
ScoobyNet General
7
Apr 22, 2001 08:05 AM




All times are GMT +1. The time now is 02:32 PM.