
Inserting a long string into a sql text field
I pass long strings to stored procedures as ADO command parameters. (param
type adBSTR).
Dim CMD As ADODB.Command
Dim PM As ADODB.Parameter
On Error GoTo ErrHandle
Set CMD = New ADODB.Command
With CMD
.ActiveConnection = adoConn
.CommandText = "proc_ins_tblCustomers"
.CommandType = adCmdStoredProc
End With
2147483647)
CMD.Parameters.Append PM
PM.Value = m_snotes
.
.
.
CMD.Execute
Raf
--
Rafael Szuminski
www.BDCSoftware.com
Quote:
> Hi,
> I posted this one a few hours earlier and haven't seen it yet. Hope both
> don'y show up.
> I have a long string, within a VB program, which I would like to insert
into
> a text column in a SQL Server database. I have been trying to use
WriteText,
> but have not been getting anywhere. I use a stored procedure to insert a
row
> into the table and get the TextPtr. The TextPtr is returned to the VB
> application. A call is then made to execute a command to use WtiteText.
> Retrieving the TextPtr results in an error: Can't assign to array. Does
any
> one have or know where I can get an example of inserting a long string in
a
> VB program into a text field within SQL Server.
> Thanks,
> Paul