Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 can not see Stored Procedures 2

Status
Not open for further replies.

Ralph8

IS-IT--Management
Mar 15, 2003
168
US
I created some Stored Procedures using Enterprise Manager for a VB 6.0/SQL Server(MSDE) project.

They look good but no matter how I try to "Execute" or "Call" them, I get a message that the compiler can not see the Sub or Function.

I have checked out the samples, etc. that MS provides in the VS Help files and the developer's web page, but I always get the same result.

Can some one point me in the right direction?


TIA

Ralph D. Meredith
 
Yeah you are right. I see now. The temp table isn't even needed.
 
My basic objective is simply to report the data I have generated with Fill_Temp_Services in the order that I need it to come out in. SQL Server 7 seems to have a mind of it's own on what order it releases the info to the report designer. The code shown below is generating the correct original set of data, and the Report is functioning OK (It is set up by "drag and drop" from the tblTempData fields).

I thought I might be able to over ride the desires of SQL Server by dumping the data into a temporary rs and then sending it back to tblTempData again and stipulate the "Order". The sp(s) were my original idea of how to do this.

The code below (True that I did not have to go the sp route) is doing OK EXCEPT that the ordering does not do anything. I have tried the "Order By" on both Select statements with the same results. SQL Server still prevails with the order it prefers (Scrambled) to go.

Actually, blaming it on SQL Server is an assumption on my part. I don't really know at this point.

Option Explicit

' Services List by Teacher
Private Sub DataReport_Initialize()

SECon = False
RSCon = False
SACon = False

'On Error Resume Next
Dim prstT As Recordset
Set prstT = frmFindReport.adoTemp.Recordset

Call Clr_Temp(prstT)
Call Fill_Temp_Services

Set rsSQLTempData = New Recordset

rsSQLTempData.Open "Select * into #rsSQLTempData from tblTempData", pCon
Call Clr_Temp(prstT)
rsSQLTempData.Open "Select * into #tblTempData from rsSQLTempData Order by Temp13, Temp6, Temp11", pCon

Dim psecH As Section
Set psecH = rptServicesSummary.Sections("Head")
pstrSName = Find_ID(frmFindReport.adoStudent, pstrFID, 0, 25)
psecH.Controls("lblName").Caption = pstrSName
psecH.Controls("lblID").Caption = pstrFID
psecH.Controls("lblReason").Caption = pstrFReason
psecH.Controls("lblMDate").Caption = Find_ID(frmFindReport.adoBasic, pstrFID, 0, 3)

End Sub



TIA

Ralph D. Meredith
 
No idea why you are still using temp tables.

But the ordering is going to work like it is supposed to, maybe thats just not what you want.

In your example all of the records are going to be in order of temp13. Where multiple records have the same value for temp13 that group will then be ordered by temp6 and where more than one record has the same value for temp13 and temp6 that group will be ordered by temp11.

Is that what you are looking for?
 
Yes, That is exactly what I want. Temp13 is a Teacher's name, Temp6 contains a description of a service provided to a Spec Ed Student, and Temp11 is the date that service begins.

It isn't working that way and I don't know why. I'm still a bit of a neophyte in this context and I'm having to do OJT on my own. Kinda painful at times. I don't suppose there is a technique to sort tblTempDatas in place?


TIA

Ralph D. Meredith
 
What you need is a Query tool to try queries out where you can see the result.

With SQL Server it is called Query Analyzer, probably the same for MSDE?

What you want to do is Start that tool, connect to your server, select the database with the table in question and
enter the query

select * from your_table_name order by temp13,temp6,temp11

Thats really all you need for what you are trying to do, no need for temp tables, that is what your VB recordset is for.

 
MSDE does not come with any interface. You can write up a simple QA in about 10 minutes tho


Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
VS 6 Enterprise entitles you to a MSDE package that includes tools such as QA and EM if you get it in CD form. The tools are not included in the download package.

MS did not make this a simple process. If an instructor that I had in class a few years ago had not clued me in that I definitely had it coming with my license I would have given up before I got it.

TIA

Ralph D. Meredith
 
If you get a CD from MS that distributes the interface then by all means use it.

Thanks for the head up Ralph8

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
I was in the USMC for 6 years from 88-94.
I now reside in Australia.

Hense SemperFi is DownUnda :)

I'm very proud of being a Marine.

Hope I've been helpful,
Wayne Francis

If you want to get the best response to a question, please check out FAQ222-2244 first
 
I suspected that was the case. We are a Navy family. I did four and all three sons were in as well. The middle one made it a career and retired a couple of years ago.

The eldest is also in Australia. He lives in Julia Creek, Queensland.


TIA

Ralph D. Meredith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top