Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Posted
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

Check out my blog! DevPaper.NET
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...