Please Help with Large Chars Fields ! 
Author Message
 Please Help with Large Chars Fields !

Hello everyone!

I've got a problem when creating a field in a dBase table with SQL:
I want that field to be able to store more than 255 chars.
But neither varchar(x) nor text data types seem to work: when posting recs
to the db, only the 255 first chars are stored
(+ I've got an error from odbc when trying "varchar(x)" where x is the
desired length for the field).

Piece of code:

FUNCTION CreateUserDb(N)
 Dim fso, CreateCmd
 tname = server.mappath("/Cli")+"\"+CStr(N)+"BAL.dbf"
 if fso.FileExists(tname)=false then
  Set CreateCmd = Server.CreateObject("ADODB.Command")
  CreateCmd.ActiveConnection = "dsn=dBASE Files;"
  CreateCmd.CommandText = "CREATE TABLE "&tname&" ("&chr(10)&"DATEMSG DATE,
OBJET CHAR(100), MSG TEXT, UNIQUEID INTEGER"&chr(10)&")"
  on error resume next
  CreateCmd.Execute
  set CreateCmd=nothing
 end if
 set fso=nothing
END FUNCTION

So, if there any way to create 'memos' or something similar?
Should I configure something in ODBC to get that work?
The goal of this field is to allow users to ask a question and to store it
in a db (similar to an online newsgroup).

Any suggestion welcome.
Many thanks in advance,
aPons.



Thu, 03 Apr 2003 08:31:08 GMT
 Please Help with Large Chars Fields !

[posted and mailed]

Quote:

>I've got a problem when creating a field in a dBase table with SQL:
>I want that field to be able to store more than 255 chars.
>But neither varchar(x) nor text data types seem to work: when posting recs
>to the db, only the 255 first chars are stored
>(+ I've got an error from odbc when trying "varchar(x)" where x is the
>desired length for the field).

For everything to work you need SQL 7 and SQL 2000. The database
must not be compability mode 60 or 65. You need to have version
3.70 or later of the OBDC driver. If these conditions are fulfilled,
you can go as far as 8000 characters.

Quote:
>So, if there any way to create 'memos' or something similar?
>Should I configure something in ODBC to get that work?
>The goal of this field is to allow users to ask a question and to store it
>in a db (similar to an online newsgroup).

In this case, you may prefer to use the text datatype. Then again,
you can always split of the text over several columns. This might
sound messy - but so is the text datatype.

--



Thu, 03 Apr 2003 03:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Please help with large chars fields !

2. Please Help with Large Chars Fields !

3. DTS problem with char fields -- please help

4. datatype for indexable char field larger than 256

5. Converting large char field to Access from Fox

6. Converting large char field to Access from Fox

7. Converting large char field to Access from Fox

8. problem with char field and special ascii char

9. processing fields char by char

10. Ordering char. field w/numeric + char data

11. COMBO BOX, PLEASE HELP, PLEASE HELP, PLEASE HELP!

12. Please Help...Convert Varbinary to Char


 
Powered by phpBB® Forum Software