Jump to content
Xtreme .Net Talk

MRCP

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by MRCP

  1. Thanks a million for that link,it explained a lot. I will try again using the concepts discussed. I am using Access 2002 as my database. I was completely unaware of the need for "permission" to create a stored procedure. How does one go about obtaining permission(would be good to know even if I don't need to create one for my purposes at this point. Thanks again for the help. MRCP
  2. Thank you both for your help. The error message I get is "An unhandled exception of type System.Data.OleDb.OleDbException". Not sure what it means but it occurs with my ExecuteNonQuery code. I think it has to do with the parameters of my Insert command, the Command Builder does not always seem to generate them for some reason. I am also a little hazy on exactly how Parameters are named(although did note the difference between SQL and OleDb naming conventions) and how many are needed for a given command. Is writing your own code for Insert and Update commands considered creating a Stored Procedure? I did try this but the syntax described in my books created all kinds of error messages. Also noted my DataAdapter Configuration Wizard will not alow me to select the "Create a Stored Procedure" from its menu(posted this last week but no takers as to why). If I am wrong about this please let me know and I will be even more grateful for your advice!
  3. I created a simple VB.Net program and am now trying to get it to input data into a Microsoft Access 2002 database. My main issue at this point is trying to work with the differences between writing ALL the code to do the work and using ADO.Net to do alot of the work(I am a beginner and have been using reference books for this learn this). I started simple, just trying to insert 3 fields from my VB.Net program(public variables FirstName,LastName,MInitial) into the appropriate columns in the database(FName,LName,MName). Set up a OleDbConnection, OleDbDataAdapter and Dataset objects on my form and configured the adapter with the Configuration Wizard. My code is this: OleDbConnection1.Open() OleDbDataAdapter1.Fill(Dataset1) OleDbDataAdapter1.InsertCommand.ExecuteNon Query() OleDbDataAdapter1.Update(DataSet1) OleDbConnection1.Close() Visual Studio code editor does not object to any of the above, but I get an exception error at the third line. My questions are: 1) Am I correct in my understanding that the DataAdapter object automatically takes care of the underlying code associated with its Insert and Update commands(as long as its Command type and Command text are properly set) and therefore can be used to insert a record into a database? 2) If #1 is true, are the changes I make to the DataAdapter's Insert and Update commands via it's Properties window persistent(ie- will they remain in effect each time the program is run or are they reset to defaults after execution)? 3) I am assuming Public variables from my VB.Net program can be inserted into the SQL Insert and Update statements to transfer their values to the database. Is this true? Thanks in advance for any help. I have read my VB.Net and ADO books over and over and still unsure of the above three! MRC
  4. I am trying to interface a VB.Net program with an Access database through Visual Studio.Net, to get new data input from the program into an Access table. Been trying to do this via the DataAdapter using its automatically generated statements (as I understand it, Visual Studio is set up to make this process easier this way). But having no luck so far. For some reason the DataAdapter Configuration Wizard will not allow me to select the "Create new stored procedures" or "Use existing stored procedures" options. Also under the Advanced SQL Generation Options it will not allow me to select the "Refresh The DataSet" option. I am completely clueless as to why, none of my reference books or the Help menu even mentions this. Any suggestions or help will be much appreciated... MRCP:confused:
  5. Man, that was fast. Thanks, I will give it a try!
  6. I am working on a VB.Net program and just finished creating a rather complex form for data input. I need to create a very similar form next, one that looks exactly like the one I just made but then assign slightly different variables for the data input. From reading my VB.net books, it seems like I should be able to use an "Inherits" statement to create a copy of the form I just made without the tedium of redoing it control by control/object by object. Is this correct, and can I then make changes to the inherited form without affecting the form it was created from? Thanks! MRCP
  7. Thanks for the response. I have Visual Studio.Net installed on my computer and have been using VB.Net through that to build my program. Is ADO.NET included with this or do I need to get additional software? If this is a dumb question forgive me, I am new at this. I had been considering getting Microsoft Access as I have heard this is often used to build databases. But if ADO.NET will work for me I will try that first, especially if it is already included in Visual Studio.Net. Thanks! MRCP PS If it makes a difference my program needs only to function at a local level, will not need to access or communicate with remote servers or via the Internet.
  8. I need to store a large amount of data in an easily searched and referenced way. After reading my VB.Net books, it seems like creating several Collections would fit my needs perfectly. However, I am not sure how one goes about creating Collections that would be permanent(ie not lose all the data in them every time the computer is shut down or the program is restarted. Can anyone help me with this? I am quite the beginner at programming VB.Net. Or if there is another(better) way of doing the above, please let me know.Thanks! MRC
  9. Thanks for the feedback about my problem. Will ShellExecute work in VB.Net,though? I read about it on another forum and was under the impression it was a VB6 command. If it will work, can you post a sample of the syntax I should use as well? Thanks! MRC
  10. I am responding to my own post to clarify. Just spent several more hours going through my VB books and several online VB.Net forums. It appears printing stuff with VB.Net is quite a handful as near as I can tell. It seems even to print a pre-existing text file will require great quantities of code defining just about every imaginable aspect of a document. This is quite depressing as it appears far beyond my ability to accomplish. So now just looking to confirm this as the reality of the situation so I do not waste more time trying to make it work! Are there any alternatives to "Print Document" or "Print Page"?
  11. I hope this is the right place to post this. I am a beginner with VB.Net and hope someone can help me with this question. Building a program in which I want to be able to access and print pre-existing text files (created with Wordpad). From the VB.Net books I have been reading, seems like the easiest way to do this is to use the "Process" component from the Components tab of the Toolbox. Indeed, I have been able to make my program open a blank Wordpad window, but unable to make it open or recognize my pre-existing files. I have ensured that my file pathways are correct, but keep getting an error message saying my file path is not recognized. I am attempting to print files from a Collection created by my program. Via debugging I have confirmed that the For Each...Next loop I am using to process the collection is working just fine. The code is like this: Public PMHName As String Public PMHFormsColl As New Collection (then intervening code to assemble the collection, which consists of variables declared as strings and assigned specific file pathways) I then use the Components tab to add a "Process" component to the form(which I name "mdprint") For Each PMHName in PMHFormsColl mdprint.Start() Next PMHName This opens a blank Wordpad window. If I make it mdprint.Start(PMHName) I get the error message. Sorry for the long post. I am totally jammed on this, any help will be much appreciated! Thanks, MRC
×
×
  • Create New...