Question about Microsoft Computers & Internet

1 Answer

Create access mdb file by vfp code

Can I get sample codes for creation of access mdb file?
for example ,I want to make a table into a mdb database by code using vfp(visual foxpro).

I wait a happy respond.

My email: korea77@nate.com

Posted by on

  • korea77 Oct 15, 2008

    Can I get sample codes for creation of access mdb file?
    for example ,I want to make a table into a mdb database by code using vfp(visual foxpro).

    I wait a happy respond.

    My email: korea77@nate.com

×

1 Answer

Try this

#define dbLogical 1
#define dbNumber 2
#define dbInteger 3
#define dbLongInteger 4
#define dbCurrency 5
#define dbSingle 6
#define dbDouble 7
#define dbDateTime 8
#define dbBinary 9
#define dbText 10
#define dbOLEObject 11
#define dbMemo 12
#define dbReplication 15
#define dbDecimal 16
if file("C:\accesstest.mdb")
delete file c:\accesstest.mdb
endif
public oAccess
oAccess = createobject("Access.application")
oAccess.visible= .t.
newMDB = oAccess.NewCurrentDatabase("C:\accesstest")
newtable = oAccess.CurrentDb.CreateTableDef('testtable')
with newtable
.fields.append(.CreateField("Field1", dbLogical))
.fields.append(.CreateField("Field2", dbNumber))
.fields.append(.CreateField("Field3", dbInteger))
endwith
oAccess.CurrentDb.TableDefs.append( newtable)
dbc2Convert = "\\tpdfiles\data\dfreeman\tip\data\rta\rta"
open database (dbc2convert)

dbgetprop(rta,"table",)

After it runs you will need to close the MDB and reopen it.

Posted on Oct 30, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

4 Answers

Access database 2003 problem with a copy of database file. How to fix?


You say corrupt, in what way exactly? Do you get any specific error numbers/messages?

Have you tried Access repair program? Compact and Repair. If not, use it. But ensure that you made a backup, it is necessary because all the recovery tips can make the damage even worse.

Also try Jet Compact Utility. This tool created by Microsoft and it is much like Compact and Repair, but more successful in repairing.

If no one of above advice helps, then perhaps you need more powerful solution. In this case try to run a good third-party. I would recommend Recovery Toolbox for Access. It must help you. https://access.recoverytoolbox.com/

Feb 23, 2015 | Microsoft Access 2003 for PC

7 Answers

MS Access database recovery


Have you tried creating a NEW MDB, and then IMPORTING the objects from the Crashed/Corrupted MDB?

This will SOMETIMES serve to rescue most if not all of the corrupted entities .

Or:
You can try:
eRepair Access is a powerful Access database recovery solution for damaged *.mdb and *.accdb files created in Access 2000 and above. Having such a tool at hand immediately after a database file corruption incident may save you a great deal of time, nerve and, of course, an ample amount of money that would otherwise be paid to third-party recovery services. With eRepair Access, you don't need to depend on anyone and entrust your Access data (often quite sensitive) into somebody else's hands. You don't have to wait. You don't have to call it a day knowing that the damaged Access file will not be restored (if at all) until tomorrow. With eRepair Access, you can be back in the game within minutes!

For more information: http://access.erepairtools.com/

If doesn't help, look here: http://www.filerepairforum.com/forum/microsoft/microsoft-aa/access/933-ms-access-database-recovery

Feb 05, 2015 | Microsoft Office Professional 2007 Full...

2 Answers

Need guidance to restore mdb file from Access


Here is a link http://www.en.accessrecovery.org and http://www.compactaccessdatabase.net on the same particular problem that I resolved effectively using this tool. This tool is smartly programmed and allow to restore database from a corrupt database table without hassle.

Apr 11, 2014 | Computers & Internet

5 Answers

How can i repair a damaged access database


There are some reasons which may damage your MS access database such as virus infection, software crash, accidental shutdown of system, unrecognized format of database, corruption of storage media etc. These issues are easy to overcome by using third party software of access database repair.you can try Kernel Access Database Recovery Software one of the best software in Data Recovery

For information you can visit here ...http://www.accessrecoverytool.net


Aug 23, 2010 | Microsoft Computers & Internet

1 Answer

Same as above really


Hi,
I have fixed my problem. I realised that the Microsoft Access Database DSN did not include the *.accdb driver. I deleted the existing DSN and created a new one. This allowed me to select the ODBC driver that worked for both file types.

I cameto realise that I was only having this problem on machines that have been upgraded to excel 2007 and not on machines with full virgin installations. On install both try to create the appropriate DSN but one with the same name already exists on the machines being upgraded and the creation fails.

I hope this helps others.

Jul 18, 2009 | Microsoft Excel for PC

7 Answers

Undelete records from access table


ou can try to use third party Access recovery utility to restore your lost and damaged data from .mdb files. For more details about this software:-
Access File Recovery

Apr 17, 2009 | Microsoft Access 2000 (077-01277) for PC

2 Answers

Convert my database from dpf to mdb


Use access to import external data. It can read dbf and create mdb

Jan 06, 2009 | Microsoft Visual FoxPro Professional...

2 Answers

Visual foxpro to access


hi
you need to use a ODBC conexion to trasport your tables into table .dbf in fox

or

you need to copy tur tables to excel documents an then import in vfp

bye

Jan 05, 2009 | Microsoft Visual FoxPro Professional...

1 Answer

Code for find the Ms access database size using visual basic


The way to get the database size is to point to the directory that the database is do a DIR statement with an output to a file as in DIR payroll.mdb>dbsize.txt and then read from the text file, the first field of the second line being the name (which you really don't need) then the size value of the database.

To import the text files using VB 8 use

'Imports System.Data.OleDb Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\path\filename.mdb") Dim cmd As New OleDbCommand("SELECT * INTO [import] FROM [Text;Database=d:\path;Hdr=No].[dbsize.txt]", conn) conn.Open() cmd.ExecuteNonQuery() conn.Close()

Nov 10, 2008 | Microsoft Office Standard for PC

1 Answer

About visual basic coding


Hello,
The standard way of creating a database using VBA, which can be modified to suit your needs is this--> Note: the code (wspDefault.CreateDatabase("Newdb.mdb"...), can be altered to save the database in a folder  such as "C:\NEWDB\text.mdb". sub NewDatabase()     Dim wspDefault As Workspace, dbs As Database     Dim tdf As TableDef, fld1 As Field, fld2 As Field     Dim idx As Index, fldIndex As Field     Set wspDefault = DBEngine.Workspaces(0)     ' Create new, encrypted database.     Set dbs = wspDefault.CreateDatabase("Newdb.mdb", _         dbLangGeneral, dbEncrypt)     ' Create new table with two fields.     Set tdf = dbs.CreateTableDef("Contacts")     Set fld1 = tdf.CreateField("ContactID", dbLong)     fld1.Attributes = fld1.Attributes + dbAutoIncrField     Set fld2 = tdf.CreateField("ContactName", dbText, 50)     ' Append fields.     tdf.Fields.Append fld1     tdf.Fields.Append fld2     ' Create primary key index.     Set idx = tdf.CreateIndex("PrimaryKey")     Set fldIndex = idx.CreateField("ContactID", dbLong)     ' Append index fields.     idx.Fields.Append fldIndex     ' Set Primary property.     idx.Primary = True     ' Append index.     tdf.Indexes.Append idx     ' Append TableDef object.     dbs.TableDefs.Append tdf     dbs.TableDefs.Refresh     Set dbs = Nothing End Sub
Hope this helps! Please let me know if you have any questions.Thank You,Raph30

Apr 10, 2008 | Oracle 10g Database Standard (ODBSEONUPP0)

Not finding what you are looking for?
Computers & Internet Logo

Related Topics:

943 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Computers & Internet Experts

micky dee

Level 3 Expert

2642 Answers

Les Dickinson
Les Dickinson

Level 3 Expert

18344 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Are you a Microsoft Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...