Script problem...

  • Thread starter Raphaël Désalbres
  • 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....
 
C

Cor Ligthert

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
 
R

Raphaël Désalbres

Hello,

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

Thanks, anyhow...

Rapha.....
 
E

Elton Wang

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top