ADO.connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ASVa
    New Member
    • Dec 2011
    • 3

    ADO.connection

    Hello
    I write this code
    Set aCon = ADO.CreateConne ction
    aCon.Connection String = cConnectionStri ng

    aCon.Open
    aCon.CommandTim eout = 300

    Set aCmd2 = ADO.CreateComma nd
    aCmd2.ActiveCon nection = aCon
    aCmd2.CommandTy pe = adCmdText
    aCmd2.CommandTe xt =
    "RESTORE DATABASE as_testing_test "& _
    " FROM DISK = 'D:\Program Files\Microsoft SQL Server\MSSQL.1\ MSSQL\Backup\as _testing_test11 1.bak' "& _
    " WITH MOVE 'as_enterprise_ model_Data' "& _
    " TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\ MSSQL\DATA\as_t esting_test.mdf ', "& _
    " MOVE 'as_enterprise_ model_Log' "& _
    " TO 'D:\Program Files\Microsoft SQL Server\MSSQL.1\ MSSQL\DATA\as_t esting_test.ldf ' "

    Set aRecSet2 = aCmd2.Execute

    After execute i have a query timeout error
    Can anybody help me about this problem
    Thanks in advance
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Have you outputted the command text and tested it in the native environment? Have you made sure the connection string is configured properly? If so, how did you do it and what were the results?

    Comment

    • ASVa
      New Member
      • Dec 2011
      • 3

      #3
      I want to restore my database and result must be a query executed successfully

      Comment

      • ASVa
        New Member
        • Dec 2011
        • 3

        #4
        and also i must compare in my test SQL databases after updateing my accounting program

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          That doesn't answer any of my questions.

          Comment

          Working...