|
-
Oct 13th, 2009, 03:33 PM
#41
Fanatic Member
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
-
Oct 13th, 2009, 03:36 PM
#42
Fanatic Member
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.
-
Oct 13th, 2009, 03:42 PM
#43
Fanatic Member
-
Oct 13th, 2009, 03:44 PM
#44
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.
-
Oct 13th, 2009, 03:45 PM
#45
Fanatic Member
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
-
Oct 13th, 2009, 03:48 PM
#46
Fanatic Member
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
-
Oct 13th, 2009, 03:49 PM
#47
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!
-
Oct 13th, 2009, 03:53 PM
#48
Fanatic Member
-
Oct 13th, 2009, 05:56 PM
#49
Thread Starter
Lively Member
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------
-
Oct 13th, 2009, 07:21 PM
#50
Re: All I need to do is populate my form....
 Originally Posted by chris128
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.
-
Oct 13th, 2009, 07:36 PM
#51
Thread Starter
Lively Member
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------
-
Oct 14th, 2009, 08:04 AM
#52
Re: [RESOLVED] All I need to do is populate my form....
haha thanks, im just glad you got it sorted in the end!
-
Oct 14th, 2009, 09:48 AM
#53
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|