Script problem...

  • Thread starter Thread starter Raphaël Désalbres
  • Start date Start date
R

Raphaël Désalbres

Hello, I'm having trouble with the following script:

Me.cnAccountingProgram.Close()
Me.cnAccountingProgram.Dispose()
Dim cnMaster As New SqlConnection("Initial Catalog=Master; Data
Source=(local); Integrated Security=SSPI")
Dim cmd1 As New SqlCommand
cnMaster.Open()
cmd1.Connection = cnMaster
cmd1.CommandText = "DROP DATABASE DB_Accounting"
cmd1.ExecuteNonQuery()
cnMaster.Close()


I get a system error?
Can anyone help me?

Thanks,

Raphaël....
 
Raphael,

Maybe when you tell us what the first two rows mean, in the rest I see no
problems.

(When you sent next time a message, than don't call it "script" next time
however "code" or even better describe what is the problem in the subject)

Cor
 
Hello,

The first two row are used to close the current connection, before I drop
the database and restore the backup....

Thanks, anyhow...

Rapha.....
 
Hi Raphaël,

Not sure. But you can check if the count has enough
permission to drop DATABASE DB_Accounting.

HTH

Elton Wang
(e-mail address removed)
 
Back
Top