473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to set widths and dec places of Foxpro 2.5 tables using ADOX?

Hello experts, I am making a vb6 program that needs to create a Foxpro 2.5 table using ADOX. I know this is quite old. You see, our company's still using these tables. And we need to make a program from vb6 that can create a dbase III table w/ it's structure copied from an existing dbase table.

Now, I had codes that does create the table w/o errors. My problem is with the numeric fields(adinteger, adnumeric, addecimal, etc.). I can't set the width and the decimal places of the fields, even though I've tried setting the Precision, NumericScale, and DefinedSize with their corresponding data types. It does create the table with these fields, but in Foxpro 2.5, the datatype is Numeric; width=20; dec=5. Do you have any ideas on how to manipulate the width and dec places when creating a dbase III table? If you have, I will greatly appreciate it. Thanks in advace!

Below are the codes:
Expand|Select|Wrap|Line Numbers
  1. Global tbl As New ADOX.Table
  2. Global cat As New ADOX.Catalog
  3.  
  4. Public Sub createtable()
  5.  
  6. cat.ActiveConnection = _
  7. "Provider=Microsoft.Jet.OLEDB.4.0;" & _
  8. "Data Source=" & pathcdate & ";" & _
  9. "Extended Properties=dBase III;"
  10.  
  11.  
  12.     tbl.Name = collfilename
  13.     tbl.Columns.Append "CDATE", adDate
  14.     tbl.Columns.Append "ID", adNumeric
  15.     tbl.Columns.Append "BATCH", adVarWChar, 4
  16.     tbl.Columns.Append "MNTHEFF", adInteger, 3   'NO EFFECT: STILL, WIDTH=20 AND DEC=5
  17.     tbl.Columns.Append "POSTED", adBoolean, 1
  18.  
  19.     With tbl.Columns.Item("ID")
  20.         .ParentCatalog = cat
  21.         .Precision = 5
  22.         .NumericScale = 0        'THE CREATED TABLE IN FOXPRO SAVED THE WIDTH=20 AND DEC=5
  23.  
  24.     End With
  25.  
  26.     cat.Tables.Append tbl
  27.  
  28. End If
  29. End Sub
  30.  
Feb 17 '11 #1
0 1131

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Sajid | last post by:
Hi! Bill, Actually I am using the following code to pack my FoxPro tables (Not Visual FoxPro tables). You know when you delete records from FoxPro they are just marked for deletion and don't get...
3
by: Sarah | last post by:
Hi I am using vb.net Is it possible to fetch data from foxpro tables (vfp8) and update tables in sql server 2000? The table structures of the foxpro tables are different from those in sql...
2
by: Tim Frawley | last post by:
I am attempting to change the ODBC Link Provider String in an Access database linked to an Oracle server using ADOX in VB.NET. I created some code using the example from post:...
3
by: gaffar | last post by:
Sir, Using ADOX I am developing an application in vb.net and the backend database is ms-access. i have created ms-access databse and tables and assigned primary keys to the tables through the...
2
by: gaffar | last post by:
Hello Sir, i need the funtionality of Using ADOX to create a JET Database and tables in it and one to many relationship between the tables. Thanks for your help Gaffar.
2
by: gaffar | last post by:
Hello Sir, i have done the funtionality to create a JET Database by Using ADOX. now my problem is to establish relationship between the tables. i have one master table and 3 child tables basing on...
1
by: Gaffar | last post by:
Hello Sir, i have created ms access database file by using ADOX. in which i have created 4 tables. 1 master table and 3 child tables. in the master table i have assigned primary key and in the...
2
by: genojoe | last post by:
Using ADOX to update a Property does not work. I want to change the Access database for a linked table. My abridged code is: Dim oCAT As ADOX.Catalog oCAT = New ADOX.Catalog...
4
by: Frank Rizzo | last post by:
I am using ADOX to make changes to an Access database that would be difficult to do via the System.Data.OLEDBClient. So far I have no trouble actually doing the work, however, I have trouble...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.