Results 1 to 4 of 4

VB Programmers :(

This is a discussion on VB Programmers :( within the Off Topic forums, part of the Entertainment category; Hello, hope someone who knows how to program can help me out. I am using access and Visual Basic. What ...
Page: 1


  1. #1
    TunaFishyMe
    Guest

    Default VB Programmers :(

    Hello, hope someone who knows how to program can help me out.

    I am using access and Visual Basic. What Im doing is copying tables from one database to another database and placing the records in the correct able so that the already existed application can be used. These tables are linked with primary keys and access does not allow 2 different indexes to be identical with different primary keys. First I have to scan if the index already exists in the database. If it doesnt, I have to add it. Now problem is a god dam space in the index. If I have something called "apple" and something called "apple " VB considers them different whereas access considers them the same. I am doing a field by field comparison using SQL so if "apple" is already in the database and I scan if "apple " exists, VB will tell me it doesnt exist and try to add it, but access will then tell me it exists!! I cant mark where the "apple" was since it a index by index comparason.


    I thought of doing a character to character check but that just takes too much time and isnt really efficient since I have to scan each letter for each index.
    Is there another way?

  2. #2
    Yun_Yuuzhan
    Guest

    Default

    Use String.Trim() in your comparison sub, it will compare the two strings disregarding all spaces after the last alphanumeric character.

  3. #3
    TunaFishyMe
    Guest

    Default



    so uhhh...give me an example

    If String.Trim(rsTemp.Fields(1)) = String.Trim(rslala.Fields(2)) Then




    End If

    ??

  4. #4
    Yun_Yuuzhan
    Guest

    Default

    That should be the gist of it, yes. Gl.

Bookmarks

Posting Permissions

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