CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Location
    Virginia
    Posts
    20

    upgrade VB6 to VB.Net w/Access

    I've upgraded a small utility program. It connects to an access database. This database has field names with spaces. This worked fine in VB6 using [] as in myDB![with spaces] but .Net barks at it and the error is Identifier Expected.

    I've tried double quotes...curly brackets...no brackets...nothing worked that I thought of.

    Any help would be appreciated...
    thanks!

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,271

    Re: upgrade VB6 to VB.Net w/Access

    I'm just going to add a few comments.
    • using spaces in FieldNames aren't really advised (IMO) - I would much rather recommend using the LNC naming convention
    • Using spaces in names, get confusing, especially when Inserting new records etc.
    [SIGPIC][/SIGPIC]
    All my Articles
    Hannes

  3. #3
    Join Date
    May 2005
    Location
    Sterling Heights, MI
    Posts
    74

    Re: upgrade VB6 to VB.Net w/Access

    Quote Originally Posted by cmazsmith
    I've upgraded a small utility program. It connects to an access database. This database has field names with spaces. This worked fine in VB6 using [] as in myDB![with spaces] but .Net barks at it and the error is Identifier Expected.

    I've tried double quotes...curly brackets...no brackets...nothing worked that I thought of.

    Any help would be appreciated...
    thanks!
    The easiest and least painful solution is to rename your fields and put underscores where there are now spaces.

    I just tested this on an Access database and you will not lose any data.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured