Inserting a long string into a sql text field 
Author Message
 Inserting a long string into a sql text field

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



Tue, 19 Oct 2004 04:08:01 GMT  
 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



Wed, 20 Oct 2004 01:49:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Inserting a long string into a sql text field

2. Inserting long text string into form fields

3. SQL Server (ADO) Can't Insert Strings Longer Then 30 characters

4. Insert Text into a memo field using SQL

5. Inserting Word Documents into SQL Server Text Field

6. AddNew field assignments take long time for text fields

7. insert vs overwrite into a (longer) string

8. INSERT vs overwrite into a (longer) string

9. Inserting Data into LONG data type field in an ORACLE Table

10. long INSERT SQL works 2 out of 3 times

11. Sql, make string field a date field.

12. Insert of Long Text

 

 
Powered by phpBB® Forum Software