Page 2 of 2 FirstFirst 12
Results 41 to 53 of 53

Thread: [RESOLVED] All I need to do is populate my form....

  1. #41
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: All I need to do is populate my form....

    No, you can use parameters in OLEDB, I do it all the time (as I said I tested his code and it passed with no issues, after I added the semi colon to the connection string!). Unlike SQL though, you must add them in the order that they are found in the code. So if you have @Order and then @Number you must put them in that exact order.
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  2. #42
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: All I need to do is populate my form....

    would be weird if it was the connection string causing the problem. Usually you would see an error dealing with a connection problem if there as an issue with your connection string.

  3. #43
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: All I need to do is populate my form....

    Of course, I also generated a copy of the database by copying and pasting his column names into the table (from the SELECT statement). If he is still getting the issue after adding the semi colon then most likely he spelled something incorrectly OR the column(s) does not exist. I am pretty much an self proclaimed expert on this by now, I have made that mistake almost every time!!

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  4. #44
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: All I need to do is populate my form....

    speaking of connection strings etc I just noticed that there isnt actually a call to Open() on the connection... or dont you have to do this when using DataAdapters etc? I dont normally use them, I normally just open a connection, build a Command, execute it and read the result using a DataReader, then close the connection.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #45
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: All I need to do is populate my form....

    His method is not one that I tend to use either, however the command object does open the connection along the way as it is needed.

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  6. #46
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: All I need to do is populate my form....

    yep, using data adapters you don't need to open or close the connection. All you need to do is assign a value for the connection property and it handles it for you.

    dminder - I loathe Access (well, at least once I started using Oracle/SQL Server), explains why these errors are a bit foreign to me

  7. #47
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: All I need to do is populate my form....

    I loathe Access (well, at least once I started using Oracle/SQL Server)
    Join the club!
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  8. #48
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Re: All I need to do is populate my form....

    Part of the reason I have gotten pretty good with this is that I have had to fix so many other peoples errors with access and vb.....

    I also like to work with Oracle, MySQL, SQL - when the opportunities afford themselves!!

    D
    Platforms of choice: Visual Studio 2005/2008 Professional : Visual Studio 2010 Enterprise : PHP - Notepad++/WAMP

    Please Rate If I helped you.
    Please remember to mark threads as closed if your issue has been resolved.

    Reserved Words in Access | Connection Strings

  9. #49

    Thread Starter
    Lively Member chr1spy1's Avatar
    Join Date
    Jan 2008
    Location
    Either I'm Tron or I'm stuck in SQL Server...
    Posts
    105

    Re: All I need to do is populate my form....

    ARRRRRRRRGH GOSH DARN IT.

    I thought to myself I should go into my database and see if my test ticket number was written down correctly - it was, but just as I was closing my database, I noticed that someone has gone in AND CHANGED ONE OF MY COLUMN HEADERS. They added three new columns (I orginally had Reported_User; they changed it to Reported_by_User_Phone, Reported_by_User_Email, and Reported_by_User_WalkUp). These columns are way over to the far right of my table, and were shrunk down so all I saw was "Rep". As I said, I was just closing the database and saw three "Reps", which I thought was weird. Lo and behold, I am going to kill someone tomorrow. Thing is, no one in my group other than me is working on this - I've shown it to a couple of people, but that's it. I am now going to be password protecting everything I have. ARRRRRRRRRGH.

    OK, so now that i've wasted 9 full hours, plus all of your time, I need to go eat dinner. I will read the rest of the posts here after that, and will show this thread as resolved.

    I'm cursing violently in my head right now.
    Chris
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d-@ s: a C++++ U--- P> L> E- W+++ N o k- w--- o-- M- V? PS++ PE- Y+ PGP- t+ 5> X+++ R> tv+ b+++ DI+++ D+ G++ e++ h--- r+++ y+++
    ------END GEEK CODE BLOCK------

  10. #50
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: All I need to do is populate my form....

    Quote Originally Posted by chris128 View Post
    That is naff... why the hell does the OleDbCommand let you add named parameters if that is the case!
    It's nothing to do with the OleDbCommand. It's the underlying OLEDB provider that decides what it supports. In this case I assume that it's for clarity. I always use parameters with names when using Access for clarity, even if they aren't used internally.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  11. #51

    Thread Starter
    Lively Member chr1spy1's Avatar
    Join Date
    Jan 2008
    Location
    Either I'm Tron or I'm stuck in SQL Server...
    Posts
    105

    Re: All I need to do is populate my form....

    OK, so - looks like dminder was the one who guessed that it was a column name problem (ie. that I'm a dolt and should a) password protect my dev db's and b) verify the data occasionally). So, a couple of other points:

    - I learnt everything I know about databases using Access, so I guess I have a bit of a nostalgic tie to it. however, now that i've been using SQL Server (although it's still 2000), I have found a new love in Databases. Only reason why I'm using Access at all is because we need to run this application locally and / or off the server, and we have another application that keeps us from using an MSDE.
    - There are obviously 14,000 different ways of doing something as simple (ha ha) as returning data from a database; as I'm currently working on performance optimisation for my group's main application, I wonder if there are performance issues depending on what is being queried / returned...things to think about.
    - I'd really like to thank chris128, backwoodscoder, dminder, and jmcilhinney (for getting me started). You all definitely rock and your time is appreciated.

    OK, I'm going back to coding. This day will be one I laugh about, but maybe tomorrow.

    Thanks again all!!
    Chris
    -----BEGIN GEEK CODE BLOCK-----
    Version: 3.1
    GIT d-@ s: a C++++ U--- P> L> E- W+++ N o k- w--- o-- M- V? PS++ PE- Y+ PGP- t+ 5> X+++ R> tv+ b+++ DI+++ D+ G++ e++ h--- r+++ y+++
    ------END GEEK CODE BLOCK------

  12. #52
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] All I need to do is populate my form....

    haha thanks, im just glad you got it sorted in the end!
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  13. #53
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    Re: [RESOLVED] All I need to do is populate my form....

    glad to see you got this one fixed. You should carry a yardstick and smack peoples hands when they touch your work without asking :P

Page 2 of 2 FirstFirst 12

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