Solved

convert .ddl file to an access db file?

Posted on 2004-08-21
13
891 Views
Last Modified: 2012-05-05
how to convert .ddl file to an access db file? what tool to use?
0
Comment
Question by:she1
  • 6
  • 6
13 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11858850
a file with the extension .DDL is a file which contains Data Definition Language (CREATE TABLE... etc).

The best you could do would be to EXECUTE that DDL, to create that tables, though this may not be completely possible, since Access amy or may not support the Data Types specified in the .ddl file.  The best you can do is to open the .ddl file with Notepad, and look at the commands that you find.

AW
0
 

Author Comment

by:she1
ID: 11858968
yes , i can open the file with notepad and see these command,
but is there a tool run these command to creat the table?
0
 
LVL 17

Expert Comment

by:BillAn1
ID: 11858985
You can simply paste them into a query (one at a time!) in Access
However, as Arthur Wood points out, they may not work in Access, if the data types are wrong, or if there is any sophisticated DDL, such as creating indexes, constraints etc. a lot of DDL is database-specific.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11859552
can you paste the DDL from the file, so we can look at it, and then be better able to advise you as to what to do next?

AW
0
 

Author Comment

by:she1
ID: 11862502
DROP TABLE AutoStock;

CREATE TABLE AutoStock (make varchar(25), model varchar(25), year integer,
  color varchar(25), mileage integer, price float(10),
  vin integer PRIMARY KEY);

INSERT INTO AutoStock VALUES (
'Porsche', '911', 2001, 'Black', 25, 90000, 123456
);

INSERT INTO AutoStock VALUES (
'Ferrari', 'Maranello', 2001, 'Red', 15, 200000, 24601
);

INSERT INTO AutoStock VALUES (
'Lamborghini', 'Diablo', 2001, 'Yellow', 20, 275000, 80386
);

INSERT INTO AutoStock VALUES (
'Audi', 'TT', 2001, 'Gray', 25, 40000, 5000
);
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11864036
this is clearly DDL for Microsoft SQL Server, and there are some siginificant differences between the datatype is Access and SQL Server (Access does not support varchar text fields, and Access Integers are not exactly that same type as SQL Server Integers - An SQL INTEGER field is more correctly an Access LONG INTEGER Access also does not support the SQL Server datatype 'float')

Also, this contains both DDL (CREATE TABLE ...) and DML (Data Management Language - INSERT INTO...) statements, and these would need to executed SEPARATELY in Access.  Access can only execute ONE SQL statement per file, not a block such as this.


There is no DIRECT way to convert the SQL Server DDL file to the equivalent Access cvommands - there is no single program that can do this, short of executing the DDL file into SQL Server (creating the table and importing the data), and then exporting the SQL Server table as a Access table (using SQL Server DTS - Data Transformation Service), or Linking Access to the SQL Server table, and importing the data into an equivalent Access Table.

AW
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:she1
ID: 11864075
thanks , is it possible to "importing the data into an equivalent Access Table." directly?
"
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11865197
if you use SQL Server DTS, then you can export from SQL Server directly to a table in your Access database, if that is what you mean.


But that DDL is so simple, why don't you simply create the same table in Access (Table/New)???

AW
0
 

Author Comment

by:she1
ID: 11866513
but later on, I have a more complicated DB, and i want to convert it again, what can i do?
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 30 total points
ID: 11869718
your best approach would appear to the to execute the DDL in SQL Server, and then export the tables to Access.  As I said, there is no direct way to execute the SQL Server DDL in Access, as the datatypes are too differennt, and the SQL Server DDL incluudes MULTIPLE sets of commands, and Access can only execute one command per instruction set.

AW
0
 

Author Comment

by:she1
ID: 11876686
actually the database is cloudscape. my i just run the command in access?
or i have to run it at sql server?
0
 

Author Comment

by:she1
ID: 11960221
actually , it might be the cloudscape DB. i am not sure it is or not?
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11962440
I doubt that it is Cloudscape, as CloudScape appears to be an object-relational database management system (ORDBMS).  And I doubt that IBM would use the same command architecture as MicroSoft ( and the DataTYpes specified in the DDL are definitely SQL Server DataTypes).

AS I indicated on 8/23 - process the DDL in SQL Server, and then import the tables into Access, and you should be set to go.

AW
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Read about achieving the basic levels of HRIS security in the workplace.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now