Creating new Database with SQLDMO crashes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi,

We have a VB.Net app that creates a new SQL database based on the structure
of another "template" database. In typical fasion, this VB.Net app casts a
reference to the RCW-wrapped SQLDMO library.

On our development machines and even in our 2-tier QA environment, this code
works fine. But on our Beta server (which is also 2-tier) it crashes and
completely bypasses the try..catch code. We've compared the .DLL versions of
DMO on both client and server machines and they look fine.

Originally, this was written as a web application, but because of potential
privilege problems, we've also re-written it as a Windows app.

As a web app we get an event log error that says there was a problem
"unloading a .Net application domain from memory" and the ASPNET process
crashes. As a Windows app we sometimes get a "Fatal Execution Engine
Failure", but it, too, always crashes.

The interesting thing is that, by monitoring the applications progress using
SQL profiler, we can see that it is dying near the end of the Database
creation process: the new database schema is created, objects (tables) are
created, but the transferring of data does not complete.

Here is some sample code:
---
oSQLServer = New CCW_SQLDMO.SQLServer
oSQLServer.Connect(strDbServerName, strSqlAdminUserID, strSqlAdminPassword)

' create a reference to the source database
DBSource = oSQLServer.Databases.Item(sourceSiteCode)

' configure the transfer object
oTransfer = New CCW_SQLDMO.Transfer
oTransfer.CopyAllDefaults = True
oTransfer.CopyAllObjects = True
oTransfer.CopyAllRules = True
oTransfer.CopyAllStoredProcedures = True
oTransfer.CopyAllTables = True
oTransfer.CopyAllTriggers = True
oTransfer.CopyAllUserDefinedDatatypes = True
oTransfer.CopyAllViews = True
oTransfer.CopySchema = True
oTransfer.ScriptType = CCW_SQLDMO.SQLDMO_SCRIPT_TYPE.SQLDMOScript_Default Or
CCW_SQLDMO.SQLDMO_SCRIPT_TYPE.SQLDMOScript_NoDRI
....
' copy schema
DBSource.ScriptTransfer(oTransfer,
CCW_SQLDMO.SQLDMO_XFRSCRIPTMODE_TYPE.SQLDMOXfrFile_Default, _
strFolderPath)
DBSource.Transfer(oTransfer)


---
The code is halting on the "ScriptTransfer" line.

--
- Tony D
.



Relevant Pages

  • Re: Portable Database Choice
    ... I searched this group quite a bit looking for database alternatives and did find the options below from this search. ... I'm posting this in the hope it can be of use to other developers in a position similar to mine where I needed a low cost alternative to Pocket Access. ... One app requires synchronization between desktop and mobile device, the other requires a push of data from the desktop to mobile. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Portable Database Choice
    ... > database alternatives and did find the options below from this search. ... One app requires ... > push of data from the desktop to mobile. ... > Both of these apps used Pocket Access on the device with Peter Foot's ...
    (microsoft.public.dotnet.framework.compactframework)
  • Portable Database Choice
    ... database alternatives and did find the options below from this search. ... of data from the desktop to mobile. ... The read-only app requires speedy lookup of data in a flat table ... Both of these apps used Pocket Access on the device with Peter Foot's ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Number of users
    ... having multiple instances of the same database open. ... "Gina Whipp" wrote: ... developing with the usage of multiple instances of the ... Restricting the user the one instance of the app makes it expotentionally ...
    (microsoft.public.access.modulesdaovba)
  • Re: Sqlserverce class not working when VB.Net application is running from network drive
    ... one app attempts to connect to a sdf file on a network share, ... possible that the database is already in use when you attempt to ...
    (microsoft.public.sqlserver.ce)