Migration from MS Access 97 to SQL Server 7.0

Migration from MS Access 97 to SQL Server 7.0

Post by Martino Gusmin » Tue, 20 Jul 1999 04:00:00



I'm trying a porting of an MS Access 97 DB to SQL Server 7.0.
First of all, I used MS Access Upsizing Tool: it's almost all OK (it created
tables and triggers) but, since my table names and field names contain some
blanks, the tool created tables and fields with modified names and  Access
queries allowing Access to work with them.
Since SQL Server 7.0 allows blanks in table and field names, I tried to
import my DBin Access 2000.
It works fine both for tables and relationships.
In Access 2000 I can then use the Upsize Wizard that I find in the tools
menu.
Tables and delete triggers are imported well, but update and insert triggers
aren't. Why????

Any suggestions?
Thanks
Martino Gusmini

 
 
 

Migration from MS Access 97 to SQL Server 7.0

Post by Sebastian Horbac » Tue, 27 Jul 1999 04:00:00


Ciao Martino,
which Version of Upsize Wizard are you using?
Last week my colleague and me tried to do just the same thing. we found out,
that there are problems with the INSERT- and UPDATE - triggers if you are using
a foreign key. It doesn't handle the case that the field is empty. So we looked
at the sourcecode of Update Wizard and changed the part which creates the
trigger.
This is the original version:
'stSQL = stSQL & "           (SELECT COUNT(*) FROM " & stMaster & ", _
inserted WHERE (" & stRestr & "))" & vbCrLf
Here is the modification which should work:
stSQL = stSQL & "          ((SELECT COUNT(*) FROM " & stMaster & ", _
inserted WHERE (" & stRestr & ")) + "
        stSQL = stSQL & "(SELECT COUNT(*) FROM inserted WHERE " & _
stRestrNull & "))" & vbCrLf
stRestrNull is a string which keeps the Condition that the foreign key field
could be empty. It is determined by a function like :
stRestrNull = StBuildRelRestrNull(rel, "inserted", stSeperator:="AND")
Tis changes have to be made in the parts commented with: "SLAVE INSERT TRIGGER"
and "SLAVE UPDATE TRIGGER".
The source code that function could look like:
Function StBuildRelRestrNull(rel As Relation, ByVal stOtherTable As String, _
ByVal stSeperator As String) As String
    Dim stSQL As String
    Dim fd As Field
    Dim stForeignName As String

    stSQL = ""
    For Each fd In rel.Fields
        If stSQL <> "" Then stSQL = stSQL & " " & stSeperator & " "
        stForeignName = UT_StRemotizeName(fd.ForeignName)
        stSQL = stSQL & stOtherTable & "." & stForeignName & " IS NULL"
    Next fd
    StBuildRelRestrNull = stSQL
End Function
Probably the problem will be fixed for a later version of Update Wizard. Till
then I hope this helps.
Sebastian

Quote:> I'm trying a porting of an MS Access 97 DB to SQL Server 7.0.
> First of all, I used MS Access Upsizing Tool: it's almost all OK (it created
> tables and triggers) but, since my table names and field names contain some
> blanks, the tool created tables and fields with modified names and  Access
> queries allowing Access to work with them.
> Since SQL Server 7.0 allows blanks in table and field names, I tried to
> import my DBin Access 2000.
> It works fine both for tables and relationships.
> In Access 2000 I can then use the Upsize Wizard that I find in the tools
> menu.
> Tables and delete triggers are imported well, but update and insert triggers
> aren't. Why????

> Any suggestions?
> Thanks
> Martino Gusmini


 
 
 

1. MS-Access 97 to SQL Server to MS-Access 97

Hi this is a thread from another news group that has not been
answered. Any ideas anyone?

Thank You, Thank You...you hit it right on the money. It seems SQL
import/export converted all my MS-Access memo fields to the SQL ntext
data type. Does SQL Server have a comparable memo field type? If not
how do people get around the memo field requirement? Create text field
large enough for the average requirement?

Thanks Again

On Thu, 17 Jun 1999 16:40:30 +0400, Alexey Dolganov

2. SQL Server 6.5 vs. Access

3. Transfer Data from one table to another

4. Migration fromm Access 97 to SQL Server 7.0

5. VB package back to SQL package

6. migration from Access 97 to SQL SERVER 7.0

7. General Index question

8. MIGRATION FROM ACCESS 97 TO SQL SERVER 7.0

9. Migration from MS Access 7.0 to MS SQL Server 6.5 - NEED HELP

10. SQL Server 7.0 database with MS Access 97 Frontend

11. Dr. Watson Errors (SQL-Server 7.0 backend, MS Access 97 frontend)