Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual 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 ASP Free Forums Sponsor:
  #1  
Old August 27th, 2005, 11:49 AM
CaffeineJunkie CaffeineJunkie is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Posts: 1 CaffeineJunkie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 36 sec
Reputation Power: 0
Exclamation Need help on retrieving table names from database

I have a listbox on my form which i need to fill with the table names from an Access database. I have used the following code to do this, but i think there is a reference missing and i don't know which one, because
Code:
Dim daSQL = New SQLDataAdapter(sSQL2, Connect)

and
Code:
Dim Connect As New SQLConnection(sConnectionString)

keep coming up in red and saying that the end of statement was expected ?!?!?!?

Rather Confused, please help - Code Follows:
Code:
While Not rsACD1.EOF
Dim myItem As String
Dim sConnectionString
        Dim dtTables As New DataTable
        sConnectionString = cnACD1
        'Create connection object
        Dim Connect As New SQLConnection(sConnectionString)
        Dim sSQL2 As String
        sSQL2 = "Select Name from dbo.sysobjects "
        sSQL2 = sSQL2 & "where OBJECTPROPERTY(id, N'IsView') = 1 "
        sSQL2 = sSQL2 & "OR OBJECTPROPERTY(id, N'IsUSERTABLE') = 1 "
        Dim daSQL = New SQLDataAdapter(sSQL2, Connect)
        daSQL.Fill (dtTables)
        lstACD1.DataSource = dtTables
        lstACD1.DisplayMember = "Name"
Wend

Reply With Quote
  #2  
Old August 28th, 2005, 06:18 PM
Adomus Adomus is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2005
Location: England
Posts: 194 Adomus User rank is Private First Class (20 - 50 Reputation Level)Adomus User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 59 m 5 sec
Reputation Power: 4
if you using VB and not VBS then
instead of
while not ....
wend

you need

do while not .....
loop

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Need help on retrieving table names from database


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 6 hosted by Hostway
Stay green...Green IT