I have written a VBscript class that converts SQL-Server and My-SQL database creation scripts to something that can be used on access.
Aside from a few errors with string manipulation on my part it's all gone rather smoothly.
I can now use ASP aps that require Access or SQL and sue the SQL script to populate the database.
Now my issue.
Alter Table ...
The syntax seems to be different between Access and MS-SQL.
Take this for example
I can deal with the "GO" and I can detect that it is an Alter Table and I can modify for the [dbo]. and remove it but the next step is to identify what it SHOULD say to be valid for MS-ACCESS 2000.Code:ALTER TABLE [dbo].[openwiki_categories] ADD CONSTRAINT [DF__openwiki___categ__7849DB76] DEFAULT ('default') FOR [categories_name] GO
The SQL that I'm testing with comes from the open wiki project and has "more complex" parts like this:
but at the end of the day they are all fairly simple patern wise.Code:ALTER TABLE [dbo].[openwiki_macrohelp] ADD CONSTRAINT [DF__openwiki___macro__7908F585] DEFAULT (1) FOR [macro_builtin], CONSTRAINT [DF__openwiki___macro__79FD19BE] DEFAULT (0) FOR [macro_numparams], CONSTRAINT [DF__openwiki___macro__7AF13DF7] DEFAULT ('No description available') FOR [macro_description], CONSTRAINT [DF__openwiki___macro__7BE56230] DEFAULT ('None') FOR [macro_param1], CONSTRAINT [DF__openwiki___macro__7CD98669] DEFAULT ('None') FOR [macro_param2], CONSTRAINT [DF__openwiki___macro__7DCDAAA2] DEFAULT ('None') FOR [macro_param3], CONSTRAINT [DF__openwiki___macro__7EC1CEDB] DEFAULT ('None') FOR [macro_comment] GO
If any one can help me as my skill with constraints beyond a clumsy primary key is a little lacking.



Reply With Quote