bluejaguar456 Posted March 30, 2009 Posted March 30, 2009 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. Quote
Fork501 Posted April 2, 2009 Posted April 2, 2009 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. I'd 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 you're 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 you're calling information from your database? Is this a website, or a Windows form? Hopefully we can solve this, once and for all =) ~Derek Quote Check out my blog! DevPaper.NET
bluejaguar456 Posted April 8, 2009 Author Posted April 8, 2009 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 '\\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) DOESN'T 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 Quote
Administrators PlausiblyDamp Posted April 12, 2009 Administrators Posted April 12, 2009 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? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.