Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2008
    Posts
    3

    Red face Unanswered: New Login Genetated when a script is run

    Hi.
    First of all, I should say that I wrote this code in Delphi. but it seems that the problem is more general and relates to Ado or sql server engine.
    I have a query component that is opened in server and I want to run a script in server from my delphi program. when i do that , i saw in sql profiler that a new login to server has been generated(Audit Login) and i don't now why. the problem is that I want to run some sql code in this way and whenever a new login is generated in sql previous codes are lost. Please Help Me!

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    That just means you connected to the server. A new login has not been created, a new connection has been created.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Some things in SQL Server are scoped to the connection. Is this what you mean by losing "previous codes"? Do you mean variables, temporary tables etc?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Dec 2008
    Posts
    3

    Red face New Login Generate...

    Yes, Exactly. After opening a query in server I want two run some scripts for example Begin Tran Save Tran T1 ... RollBack T1 and ... .
    but After running Begin Tran, Save Tran T1 generate Error that says there is no active tranasaction, something like that.

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    One thing I can guarantee - this is nothing to do with a problem with the SQL Server. It accepts connections and executes requests, that's it. Something else in your application is causing multiple connections. If I had to bet, I would bet on your code. Are you closing and recreating connections, or destroying and recreating ADO objects?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Dec 2008
    Posts
    3
    Yes. I know that dear freind.
    Here is some sudo Code:
    Connection1.Open;
    AdoQuery1.SQL.Text := 'Select * from T1';
    open AdoQury;

    exec script 'Begin Tran'
    exec script 'Save Tran T1'
    when reach to above line gen error I've mentioned.

  7. #7
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Please could you post your actual code? And the exact error message? There's no such SQL command as SAVE TRAN.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  8. #8
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11

  9. #9
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Anyway, transaction T1 is not started anywhere. So it can not be saved, or committed.

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Oops.
    I've never used SAVE. Apols - my error.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •