Results 1 to 3 of 3
  1. #1
    MDelke is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Feb 2018
    Posts
    5

    Need help getting .mdb to show in datagridview in visual basic 2015

    I can get some of the tables to show but not all of them. I know mdb is outdated but I am trying to convert a visual basic 6 program without doing a lot of work on the database if possible.



    here is the code:

    Dim ds as New Dataset
    Dim dt as new Datatable
    ds.tables.add(dt)
    dim da as New oledbDataAdapter

    con.ConnectionString = ("my conection String Here")
    con.Open()

    da = New OleDbDataAdapter("select * from QSO - Master",con)

    DataGridView1.DataSource = dt.DefaultView

    con.Close()

    Any help would be appreciated.
    Mike

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,895
    Is QSO - Master the name of a table or query? Advise not to use spaces nor punctuation/special characters (underscore only exception) in naming convention. Those could be source of issue. Better would be QSO_Master or MasterQSO.

    Try wrapping in [].

    "select * from [QSO - Master]"


    Might find a VB forum if you have questions that are more VB than SQL related.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    MDelke is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Feb 2018
    Posts
    5
    Thanks for the help. I agree the naming convention was strange but enclosing in [] did the trick. Thank You again

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Visual Basic
    By Darth21 in forum Access
    Replies: 4
    Last Post: 08-11-2014, 06:18 AM
  2. Visual Basic Code for If Else
    By Baldeagle in forum Programming
    Replies: 1
    Last Post: 09-14-2012, 08:46 AM
  3. Visual Basic
    By kwooten in forum Queries
    Replies: 2
    Last Post: 01-25-2012, 08:22 AM
  4. trying to learn visual basic
    By darklite in forum Programming
    Replies: 7
    Last Post: 08-24-2011, 02:18 PM
  5. Can't see visual basic code
    By Michele Keck in forum Forms
    Replies: 5
    Last Post: 09-29-2010, 11:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums