Not displaying info from access database.

bluejaguar456

Well-known member
Joined
Aug 22, 2006
Messages
47
Hey Guys,

I posted a while back that i had an issue regarding a table in my access database and my program.

I basicaly cannot change the column names on the database other wise vb .net will just display the information in my program as blank and not return an error message at all.

Last time i gave up with trying to solve the problem and left all the field names the same as another table in my database which works with my program.


This is now causing me a lot of confusion when writing code, thus leading me back to you guys to see if anyone can help.

Any help will be greatly appreciated thanks :)

Bluejag.
 
Hey Guys,

I posted a while back that i had an issue regarding a table in my access database and my program.

I basicaly cannot change the column names on the database other wise vb .net will just display the information in my program as blank and not return an error message at all.

Last time i gave up with trying to solve the problem and left all the field names the same as another table in my database which works with my program.


This is now causing me a lot of confusion when writing code, thus leading me back to you guys to see if anyone can help.

Any help will be greatly appreciated thanks :)

Bluejag.

Id like to try to help you out, but your post is a little confusing.

Which version of Access are you using?

When you say changing the column name, do you mean that youre changing the name of the colulmn on the Access Database and then going back to your code and changing it there, as well?

How are you accessing the database? Do you have it set up with the Database Explorer, or are you just doing it all by hand code?

Could you show some code of how youre calling information from your database?

Is this a website, or a Windows form?

Hopefully we can solve this, once and for all =)

~Derek
 
Hey sorry for the late reply been reallly busy,

I am using access 2007 but using the .MDB extension for the database.

Yes i am changing it in both the code and the access database,

i am accessing the database through hand code, i have not learnt how to use the database explorer because i find it easier to hand code.

Here is part of the code that it fails on

Code:
\\Counts how many rows/records have been found.
        maxrows = dsclient.Tables(vardatabaseloc).Rows.Count

        If inc = maxrows - 1 Then
            Exit Sub
        Else
            \\Clear all search lbls first
            clearsearchlbl()
        End If


        \\Puts information into each search label where appropriate.

 THE FOLLOWING PART IS THE PROBLEM IF I CHANGE THE COLUMN
   NAMES ITEM(0) DISPLAYS CORRECTLY BUT ITEM(1) DOESNT DISPLAY 
    ANYTHING. BUT IF I KEEP THE CURRENT COLUMN NAME IT IS OK :S

        If inc <> maxrows - 1 Then
            inc = inc + 1
            lnkresult1.Text = dsclient.Tables(vardatabaseloc).Rows(inc).Item(0) & " / " & dsclient.Tables(vardatabaseloc).Rows(inc).Item(1)
        Else
            Exit Sub
        End If

It is a windows form not a website.

Thanks for your swift reply derek and hopefully we can sort it once and for all If ya need anymore code let me know
Thanks Again
 
What is the sql you are using to return the data? If you look at the dataset / datatable in the debugger are the table / column names the same as what you are expecting? Do the columns contain data?
 
Back
Top