Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Sql View and field lenght 1

Status
Not open for further replies.

nevin2007

Programmer
Aug 21, 2009
31
IR
Hi
I try to add an record to an ACCESS file by using
Create Sql View
. MDB file has a column with this properties :
field name : MON
data type : TEXT
field size : 4

I used this command after create view
DBSetProp("viewmahane"+".mon","Field","DataType","C(4)")
The problem is : when i insert data to MDB file ,ACCESS has additional space at the end of field data.
for example if i type ops in VFP ,in ACCESS shows ops + one space or if i type op in VFP in ACCESS shows ops + two space.
Because of that additional space the other program that use MDB file didn't work correctly
How can i fix this problem?


 
If the Access data type is TEXT I assume that's normal. Char fields are padded with spaces.

Try this:

DBSetProp("viewmahane"+".mon","Field","DataType","V(4)")

This needs VFP9.

Or try this:
DBSetProp("viewmahane"+".mon","Field","DataType","M")

Text shorter than 4 chars will not be padded.

Bye, Olaf.
 
thanks OlafDoschke
Your suggestion works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top