Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

Last resort, VB/Access ADO problem

Thread Tools
 
Search this Thread
 
Old 25 November 2002, 06:35 PM
  #1  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

Its being 6months since ive used ADO stuff. I found an old Uni program which use's this printstatement to a form.
Private Sub printFields()

If rsMatch.EOF Then 'If at the end of recordset , terminate program
Unload Form1
rsMatch.Close ' Close the recordsets
dbConnection.Close ' and the connection
Exit Sub
End If

intMatchID = rsMatch("matchID") ' Get the ID for the this match
findSquad ' Find the squad who played in this match

' Print the information to the immediate window
Debug.Print " "
Debug.Print "Match ID: "; rsMatch("matchID")
Debug.Print rsMatch("matchDate")
Debug.Print "Against: "; rsMatch("teamName")
Debug.Print "At: "; rsMatch("venu")
Debug.Print "Referee: "; rsMatch("refereeForename") + " " + rsMatch("refereeSurname")
Debug.Print "Score: " + CStr(rsMatch("us")) + " " + CStr(rsMatch("them"))
Debug.Print "Squad:"

'Loop through the Squads recordset, printing filtered players
Do Until rsSquads.EOF
Debug.Print " "; rsSquads("playerForename"); " "; rsSquads("playerSurname"); " "; rsSquads("goals")
rsSquads.MoveNext
Loop

rsSquads.Close 'Close the Squads recordset again
End Sub


Its printing the info to debug. ive tried txtans.text tried labels.

Im tearing my hair out, whats the correct code to print in either a lable or text box.

Cant do any work till i get this simple thing working!

Cheers

Si
Old 25 November 2002, 07:24 PM
  #2  
STi-Frenchie
Scooby Regular
 
STi-Frenchie's Avatar
 
Join Date: Sep 2002
Location: French side of the border at Geneva, Switzerland
Posts: 5,703
Likes: 0
Received 0 Likes on 0 Posts
Post

IMHO Debug is of limited use (only for a line or two). Try dumping the data to a text *file* using

Open filename for Output as #n

and then printing the lines to it before

Close #n

closing it. Doing it that way, you'll have a permanent record (excuse the pun) of what's being read in the recordset.
Old 25 November 2002, 07:28 PM
  #3  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

debugs the example code mate.

I want to get rid the example and put the data in either lables or text boxes.

Just want to get that working, then make a start on my assignment! but ill be bugger if i can remember what i need to put something like

txtans.txt = rsmatch("venu")

or something.....
Old 25 November 2002, 07:35 PM
  #4  
STi-Frenchie
Scooby Regular
 
STi-Frenchie's Avatar
 
Join Date: Sep 2002
Location: French side of the border at Geneva, Switzerland
Posts: 5,703
Likes: 0
Received 0 Likes on 0 Posts
Post

Isn't the default property for a textbox .text ?

Try just using txtans = rsmatch("venu")

For labels, it should be labelname.caption = rsmatch("venu")

Old 25 November 2002, 07:48 PM
  #5  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

im well pissed off whats the angry bb code

it was a fooking = i was missing!!!

Cheers matey!! much appreiciated
Old 25 November 2002, 09:49 PM
  #6  
STi-Frenchie
Scooby Regular
 
STi-Frenchie's Avatar
 
Join Date: Sep 2002
Location: French side of the border at Geneva, Switzerland
Posts: 5,703
Likes: 0
Received 0 Likes on 0 Posts
Post

No problem. Hope the rest of the assignment flows smoothly for ya.
Old 25 November 2002, 10:05 PM
  #7  
super_si
Scooby Regular
Thread Starter
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

Come up with another issue, but ill get back to you.

Going to spend a little more trying to figure it out.

Si
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Abx
Subaru
22
09 January 2016 05:42 PM
PetrolHeadKid
Driving Dynamics
10
05 October 2015 05:19 PM
T.K
General Technical
10
02 October 2015 11:35 AM
the shreksta
Other Marques
26
01 October 2015 02:30 PM
minguela
Wheels And Tyres For Sale
0
29 September 2015 11:28 AM



Quick Reply: Last resort, VB/Access ADO problem



All times are GMT +1. The time now is 10:03 PM.