Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 24th, 2003, 02:39 AM
danny__t danny__t is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Bournemouth
Posts: 16 danny__t User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Query problem

Can anyone see what the problem is here: -

Set myRecSet = MyConn.Execute("SELECT client.* from client where first_name LIKE '*Tim*'")

For arNum = 0 To ThisForm.txtTextBox.UBound
ThisForm.txtTextBox(arNum) = myRecSet(arNum) & "" ' errors here
Next arNum

I know the query works as I have tried it directly in access but in vb I am getting the error "either BOF or EOF is true...." I know the query only brings back one record but that shouldn't make any difference should it?

Reply With Quote
  #2  
Old November 24th, 2003, 08:39 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,840 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 2 Days 27 m 47 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
you have to move through the recordset
i.e.
myRecSet.MoveNext

You should also have to access each field in the recordset
i.e.
myRecSet!fieldname
or
myRecSet.Fields("fieldname").Value

Reply With Quote
  #3  
Old November 24th, 2003, 08:44 AM
danny__t danny__t is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Bournemouth
Posts: 16 danny__t User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Its ok I've sussed it, the problem was that ADO uses % instead of * for LIKE sql statements for some reason.

As for the arNum, I have the same number of textboxes as I do fields in the query so for each field a textbox gets populated, its possible to reference fields by their number order as well as their fieldname.

Cheers though mate, appreciated

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Query problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway