14 Replies - 2623 Views - Last Post: 19 October 2012 - 07:29 PM Rate Topic: -----

#1 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

trying to display table names from a database

Posted 10 October 2012 - 07:14 AM

   Dim dbs As Database
   Dim rst As Recordset

   X = 0
   
   Set dbs = OpenDatabase("c:\rr\rr.mdb")
   
   For Each rst In dbs.Recordsets
      frm09TableName(X).Caption = dbs.Name
      X = X + 1
   Next


This post has been edited by Martyr2: 13 October 2012 - 07:16 PM
Reason for edit:: Fixed code tags. Remember to place them in square brackets.

Is This A Good Question/Topic? 0
  • +

Replies To: trying to display table names from a database

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: trying to display table names from a database

Posted 17 October 2012 - 03:38 PM

Well, that won't work. Google "DAO Recordset" and see what you find.
Was This Post Helpful? 0
  • +
  • -

#3 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 17 October 2012 - 09:02 PM

View PostBobRodes, on 17 October 2012 - 03:38 PM, said:

Well, that won't work. Google "DAO Recordset" and see what you find.


Mr. Rodes,
Unfortunatley, the only suggestions I could find when I Google 'DAO Recordset' are how traverse a recordset. I need to know how traverse a database and find the names of all the tables therein. But thanks anyway for your help.
Was This Post Helpful? 0
  • +
  • -

#4 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: trying to display table names from a database

Posted 18 October 2012 - 10:22 PM

Sure enough. What else did you try googling, or did you just give up right there?
Was This Post Helpful? 0
  • +
  • -

#5 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 04:42 AM

View PostBobRodes, on 18 October 2012 - 10:22 PM, said:

Sure enough. What else did you try googling, or did you just give up right there?


No, i did not give up 'right there'. But, all information had to do withtraverse the recordset.
Any other comments Skippy?
Was This Post Helpful? 0
  • +
  • -

#6 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: trying to display table names from a database

Posted 19 October 2012 - 07:00 AM

Strange you didn't find anything, found this on the first page in google. Check the last post and see if it helps.

In future, if you're not happy with the replies, please keep your comments to yourself...we're here to help you if you help yourself.
Was This Post Helpful? 0
  • +
  • -

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: trying to display table names from a database

Posted 19 October 2012 - 01:43 PM

OK, putting your PM's aside, did you solve the problem or not?
Was This Post Helpful? 0
  • +
  • -

#8 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 01:53 PM

View Postmaj3091, on 19 October 2012 - 01:43 PM, said:

OK, putting your PM's aside, did you solve the problem or not?


not yet, but working on it. Programming is just an avocation for me. Retired AS/400 programmer.
Was This Post Helpful? 0
  • +
  • -

#9 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,776
  • Joined: 26-March 09

Re: trying to display table names from a database

Posted 19 October 2012 - 02:07 PM

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.

This post has been edited by maj3091: 19 October 2012 - 02:15 PM

Was This Post Helpful? 0
  • +
  • -

#10 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 02:44 PM

View Postmaj3091, on 19 October 2012 - 02:07 PM, said:

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.


It looks like it will, but I am not at home . I will try it to-nite and email with the results.
Was This Post Helpful? 0
  • +
  • -

#11 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: trying to display table names from a database

Posted 19 October 2012 - 02:49 PM

Sure, I got another comment Snippy. In fact I got a couple. First, if you explain your problem in a cursory manner, you'll get a cursory examination and a cursory response. Your work gets mine; I do this for an avociation, too. Suggestion for the future: don't rely on the title to explain your problem, especially if your code does something completely different from what you are trying to do. So, following my suggestion, you now know more about why your code doesn't work.

Second, the main reason that I've treated you as someone who hasn't done much work to help himself is that the research required to apprise yourself of the existence of the DAO TableDefs collection is trivial in the extreme, especially for someone with the experience of a retired AS/400 programmer.

This post has been edited by BobRodes: 19 October 2012 - 02:55 PM

Was This Post Helpful? 0
  • +
  • -

#12 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 03:33 PM

View PostBobRodes, on 19 October 2012 - 02:49 PM, said:

Sure, I got another comment Snippy. In fact I got a couple. First, if you explain your problem in a cursory manner, you'll get a cursory examination and a cursory response. Your work gets mine; I do this for an avociation, too. Suggestion for the future: don't rely on the title to explain your problem, especially if your code does something completely different from what you are trying to do. So, following my suggestion, you now know more about why your code doesn't work.

Second, the main reason that I've treated you as someone who hasn't done much work to help himself is that the research required to apprise yourself of the existence of the DAO TableDefs collection is trivial in the extreme, especially for someone with the experience of a retired AS/400 programmer.

Was This Post Helpful? 0
  • +
  • -

#13 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 03:39 PM

Mr. Rodes,

The operating system of the AS/400 (OS/400) comes equipped with about 400 procedures for local or remote database research tasks. The coding behid these procedures was never a concern of mine. I just knew they worked.
Was This Post Helpful? 0
  • +
  • -

#14 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 07:20 PM

View Postgeoleob, on 19 October 2012 - 02:44 PM, said:

View Postmaj3091, on 19 October 2012 - 02:07 PM, said:

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.


It looks like it will, but I am not at home . I will try it to-nite and email with the results.


View Postgeoleob, on 19 October 2012 - 02:44 PM, said:

View Postmaj3091, on 19 October 2012 - 02:07 PM, said:

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.


It looks like it will, but I am not at home . I will try it to-nite and email with the results.

Was This Post Helpful? 0
  • +
  • -

#15 geoleob  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 06-August 12

Re: trying to display table names from a database

Posted 19 October 2012 - 07:29 PM

View Postgeoleob, on 19 October 2012 - 07:20 PM, said:

View Postgeoleob, on 19 October 2012 - 02:44 PM, said:

View Postmaj3091, on 19 October 2012 - 02:07 PM, said:

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.


It looks like it will, but I am not at home . I will try it to-nite and email with the results.


View Postgeoleob, on 19 October 2012 - 02:44 PM, said:

View Postmaj3091, on 19 October 2012 - 02:07 PM, said:

Did the last post in that link not help at all?

It was the only one I looked at using DAO, albeit there seemed to be a few using ADO.

[EDIT] Out of curiosity I tried it and it works well.


It looks like it will, but I am not at home . I will try it to-nite and email with the results.


Yes, it did work. But, in the VisData that comes with VB, it eliminates tables that begin with "MS". I can not figure how VisData does this even after looking at VisData code. I have to eliminate them with an If/Else statement.

Thanks for you help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1