[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.6

Stored Procedure Query using ADO

Asked by theMuzz in Miscellaneous Programming, Delphi Database

Tags: 3704, procedure

For the past week I've been trying to write an application to display product quality based on customer and fiscal period.
The program runs about 15 queries on 3 different servers but despite my best attempts, the final query will not work.

Below you'll find the code as it stands now.

Things I've tried/noticed:
-When i run the stored procedure, the code crashes right at the rs2.open ("splocal_"), strConnect3 line
-This code does work when i substitute the store procedure for select * from table;
-I had the progrm dump the query it tries to run into a text file. That query did work when pasted into the Query Analyzer
-This exact code does work in another application that prints out our certificates of analysis.
-Debugging rs2 and conn2 is showing me that a connection is not being made



Public strConnect3 As String
Public Const PuId As String = "5"

Function test()
    call prConnect

            Dim conn2 As ADODB.Connection
            Set conn2 = New ADODB.Connection
            Dim rs2 As ADODB.Recordset
            Set rs2 = New ADODB.Recordset
         
            conn2.Open strConnect3

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' crashes at line below                                                                   '
' Error 3704: Operation is not allowed when the object is closed. '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
            rs2.Open "splocal_STI_EventData_Result null,null,'" & eventID & "',null,null,'/Report/',null,null,null," & PuId, strConnect3                

            rs2.MoveFirst
            While Not rs2.EOF
                msgbox rs2.fields(0)
                rs2.MoveNext
            Wend
           
            rs2.Close
            Set rs2 = Nothing
            conn2.Close
            Set conn2 = Nothing
End Function

Function prConnect()
    strConnect3 = "Provider=SQLOLEDB.1;Password=xxxxx;Persist Security Info=True;User ID=xxxxx;Initial Catalog=xxxxx;Data Source=xxxxx"

    If TestPrConnect() = False Then
        MsgBox "connection could not be made.", vbExclamation, "Error"
    End If
End Function


Function TestPrConnect() As Boolean
On Error GoTo testError
    Dim cnn As ADODB.Connection
    Set cnn = New ADODB.Connection

    cnn.Open strConnect3

    'No error means that the connect string works!
    If Err.Number = 0 Then TestPrConnect = True

    ' Clean up and release resources
    cnn.Close
    Set cnn = Nothing

Exit Function
testError:
    MsgBox "connection test error:" & vbCrLf & Err.Number & ": " & Err.Description, vbExclamation, "Error"
End Function
[+][-]06/17/03 05:45 PM, ID: 8745366Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Miscellaneous Programming, Delphi Database
Tags: 3704, procedure
Sign Up Now!
Solution Provided By: gretzky99
Participating Experts: 3
Solution Grade: A
 
[+][-]06/13/03 12:06 PM, ID: 8719995Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/13/03 12:07 PM, ID: 8720004Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/13/03 12:12 PM, ID: 8720053Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/13/03 12:20 PM, ID: 8720122Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/13/03 12:28 PM, ID: 8720186Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/03 05:19 AM, ID: 8731301Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/03 05:32 AM, ID: 8731383Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/16/03 12:49 PM, ID: 8734602Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/16/03 01:10 PM, ID: 8734783Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/17/03 04:38 AM, ID: 8739520Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/18/03 05:16 AM, ID: 8748478Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93