Solved

SQL 7 Text type

Posted on 2000-02-14
10
564 Views
Last Modified: 2012-08-14
What is the corresponding ADO DatatypeEnum for SQL 7.0 Text type.

Thanks
0
Comment
Question by:Jpresser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
10 Comments
 

Accepted Solution

by:
ramaswamy_ravi earned 50 total points
ID: 2521412
Jpresser

adLongVarchar

Regards,
Ravi

0
 
LVL 2

Expert Comment

by:freshmeat
ID: 2521461
i guess it is "adBSTR"?
^@^
only guess
0
 
LVL 2

Expert Comment

by:freshmeat
ID: 2521466
"adLongVarchar" indicates a long string value (Parameter object only).

"adBSTR" indicates a null-terminated character string (Unicode)(DBTYPE_BSTR).

so, which one is right?
"adLongVarchar " or "adBSTR"?
:)

0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Expert Comment

by:amnh
ID: 2522853
advarchar with a size of 2147483647

as in the following
cmd.CreateParameter("@answer",adVarChar,adParamInput,2147483647,answer)
0
 

Author Comment

by:Jpresser
ID: 2524002
Here is the code I am testing the text data type with:
Dim objCommand2, strConnect
   strConnect = "DSN=SALESSQL;initial catalog=Dole;UID=sa;PWD="
 
  Set objCommand2= Server.CreateObject("ADODB.Command")
  objCommand2.ActiveConnection = strConnect
  objCommand2.CommandText = "aaatest"
  objCommand2.CommandType = adCmdStoredProc
 
  Set objParameter = objCommand2.CreateParameter("@Col1",adChar,adParamInput,10,Request.Form("txtChar"))
  objCommand2.Parameters.Append objParameter
 
  Set objParameter = objCommand2.CreateParameter("@Col2",adLongVarChar,adParamInput,1100,Request.Form("txtText"))
  objCommand2.Parameters.Append objParameter
 
  objCommand2.Execute
 Response.Write Len(Request.Form("txtText"))
The length of the string I was trying to insert into the table turned out to be 1100 characters long.  The insert fails to go into the text field. of SQL Server 7.0 table.
0
 

Expert Comment

by:amnh
ID: 2524743
Jpresser,
the size of a parameter is dependant on the underlying datatype not the data you are passing to it.  I have have successfully used the 'advarchar' datatype with size 2147483647 as stated above.
0
 

Author Comment

by:Jpresser
ID: 2524967
amnh:
I tried your example, it did not work with the text type in sql server.  It works fine if I use a varchar as the data type.

When I try to insert 900 or more characters into the text type, nothing gets inserted into the field.

The example I left calls a simple stored procedure that just does an insert.  For some reason it fails to work when the character string get to the 900 or so characters. It works however, if the data type is varchar, and fails if it is text.
0
 

Expert Comment

by:ramaswamy_ravi
ID: 2525267
Jpresser

It works fine for me with adVarchar and much more than 900 characters for a TEXT column in SQL Server
0
 
LVL 3

Expert Comment

by:Hencah
ID: 2525612
Jpresser,

Have a text datatype for your text-field in the table.
But in your stored procedure, declare it as varchar(1100), like this

create procedure aaatest
 ...
 @Col2 varchar(1100)
 ...

BTW, I myself haven't try to have a parameter with text type but it's still intriguing to know what exactly the type for text parameter (not using varchar  parameter)
0
 

Author Comment

by:Jpresser
ID: 2528285
The data in the text field could not be seen after it reached a certain length. It was, however, always there.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
wordpress display sub menu only when click 12 100
Pass SQL to JSON. Page is in classic ASP and using Jquery 4 59
SQL to JSON 14 65
Adding Clickable Links to JQuery Data Items 24 58
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question