|
Yes, I've given it a try, and looks to be something to mess around with on some free time.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
No-e wrote: When a user logs on with a non administrator account and tries to run this they get a "Path/File access error". If they log in using an administrator account it works fine.
Hence, it must be something that's bound to the profile. Are you using any environment-variables? What is the path based on? Can you show an example? Any other relevant code in there that might cause errors, like reading your path from a key in the registry?
No-e wrote: Interestingly enough, it does appear to actually read the file
It "appears"? Please verify the actual behaviour; print out the contents of the file or write it to a temp location right after reading. Does or doesn't it read the file? My guess is that it didn't.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
No environment variables, path is read from a configuration file, fairly straight forward. Not sure about additional code, it is very simple procedure, this one reads it and converts it from hex to binary and returns it in an array (of small blocks to be shoved down a serial port in the calling routing).
I could have been more clear on appears, by appears, the file must be read because the system converts it and sends it to a bunch of hardware. The operator tells me they see this happening (the system shows the file being loaded in blocks), and the hardware subsequently goes off and does its thing with this new data, which works correctly.
No-e
|
|
|
|
|
Since you're getting a Path/Access Violation error, you've got one of two causes.
Either the path you built in "filename" is invalid, or the user that's running the code doesn't have appropriate permissions to the folderpath the file is in.
|
|
|
|
|
so, I'm making an ini editor for this game that has no advanced options. I found an INI reader/writer here:
http://www.mentalis.org/soft/class.qpx?id=6[^]
When I debug or run the program on my laptop (where I have windows 7 and vb2010 installed) it works fine. I dual boot to winxp works fine there too
I have two other win7 computers and JIT debugger comes up on both saying:'
Error message: An item with the same key has already been added
I see references to the ini class inside the details. Cause it uses dictionaries. But I get no exception on xp or the dev win7 install.
also note: I changed the project down to .NET 2.0 after I made the project. Does this have anything to do with it?
please help
|
|
|
|
|
Then the ini files you read on those other computers are not correct, e.g. a duplicated section.
In order to prevent the JIT debugger rom being invoked, use some try..catch in the function where you call your ini reader.
|
|
|
|
|
I am doing research on VB.Net code to pull jobs from one printer que and sending that job to another printer on the same network. Any suggestions?
|
|
|
|
|
DWprogrammer wrote: I am doing research
If you're doing research, then you probably already used Google. And if you have, you'll already know about the article[^] on CodeProject.
So, how would I know what links you have and haven't seen?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Hi everyone,
I am a beginner in VB. I have a project about expenses management.
So far I am having problem in inserting, updating and showing multiple table's data in 1 form(The expenses template)
Info:
SQL database:
Expenses(ExpensesID,Date,Food,Entertainment....Cash_Remains)
Food(FoodID,Breakfast....Sub_Total)
...........
Then when I click on next or previous it will show the same form but with new empty data or existing data(How do I do this?).
For the update part I know how to do it in the tableadapter but do I really need to create all the updates for all tables to work?
Like:
food.tableadapter.update(parameter)
entertainment.tableadapter.update(parameter)
or is there any better way?
Sorry for asking too much and also not politely in programming maner.
|
|
|
|
|
garyu87 wrote: Then when I click on next or previous it will show the same form but with new empty data or existing data(How do I do this?).
Display the form, and clear it's contents.
I'm not going to provide a personalized tutorial based on requirements; your question is very broad, and would require explanation on what Sql is, how you show a form, saving, loading, refreshing..
Start with displaying a form. Once you have that, move on to displaying "something". Once you have that, move on to "modifying". If you're stuck, ask for help - on that particular step. You'll get a ton more help if you ask a specific question on how to do something.
Walkthroughs[^]
How Do I video's[^]
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Okay, I have all the forms and templates.
For starters my problem now is that I have multiple tables that I don't know how to display it in the templates that I have created.
Let say I have a groupbox(Food) that has all the labels and textbox. How do I display the data into each textbox with table adapters.
My database has a main table Expenses(ExpensesID, Date, Food,...Allowance, Total, Remains)
then there is a table Food(FoodID, Breakfast.....Sub_Total)
tblExpenses.food = tblFood.FoodID
|
|
|
|
|
garyu87 wrote: How do I display the data into each textbox with table adapters.
I don't know how the TableAdapter[^]s work, I don't use them. Fetching data can be done with a IDataReader , as a Reader[^] is the most efficient way. That would require code like below;
Using con = new SqlConnection(connectionString)
Using cmd = con.CreateCommand()
cmd.CommandText = "SELECT * FROM Food"
con.Open()
Using rdr = cmd.ExecuteReader
TextBox1.Text += rdr.GetString(0)
End Using
End Using
End Using
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Okay thanks I'll try it out
|
|
|
|
|
You're welcome
|
|
|
|
|
I am having a problem right now where I want to display multiple table data in the all the textboxs in a form.
Here's my coding:
Sub Fill_Template()
cmd.CommandText = "SELECT tblExpenses.Date, tblFoodAndBeverage.Breakfast, tblFoodAndBeverage.Lunch"
cmd.CommandText += "tblFoodAndBeverage.Dinner, tblFoodAndBeverage.Snack, tblFoodAndBeverage.Beverage"
cmd.CommandText += "tblFoodAndBeverage.Grocerries, tblFoodAndBeverage.Sub_Total, tblHousing.Rental"
cmd.CommandText += "tblHousing.Electricity, tblHousing.Water, tblHousing.Gas, tblHousing.Supplies"
cmd.CommandText += "tblHousing.Others, tblHousing.Sub_Total, tblTransportation.Bus_Fare"
cmd.CommandText += "tblTransportation.Taxi_Fare, tblTransportation.Train_Fare, tblTransportation.Fuel"
cmd.CommandText += "tblTransportation.Maintainence, tblTransportation.Others, tblTransportation.Sub_Total"
cmd.CommandText += "tblEntertainment.Video_Rental, tblEntertainment.Cinema, tblEntertainment.Concert"
cmd.CommandText += "tblEntertainment.Sport, tblEntertainment.Club_Bar_Disco, tblEntertainment.Games"
cmd.CommandText += "tblEntertainment.Others, tblEntertainment.Sub_Total, tblPersonalCareAndItems.Medical_Fees"
cmd.CommandText += "tblPersonalCareAndItems.Hair_Or_Nail, tblPersonalCareAndItems.Clothing"
cmd.CommandText += "tblPersonalCareAndItems.Supplements, tblPersonalCareAndItems.Soap_Or_Shampoo"
cmd.CommandText += "tblPersonalCareAndItems.Facial_Cleanser, tblPersonalCareAndItems.Others"
cmd.CommandText += "tblPersonalCareAndItems.Sub_Total, tblLoan.Personal, tblLoan.Student, tblLoan.Business"
cmd.CommandText += "tblLoan.Mortgage, tblLoan.Others, tblLoan.Sub_Total, tblLegal.Attorney, tblLegal.Alimony"
cmd.CommandText += "tblLegal.Summons, tblLegal.Others, tblLegal.Sub_Total, tblPaymentsAndOthers.Phone_Bill"
cmd.CommandText += "tblPaymentsAndOthers.College_Fee_And_Misc, tblPaymentsAndOthers.Vehicle_Payment"
cmd.CommandText += "tblPaymentsAndOthers.Vehicle_Insurance, tblPaymentsAndOthers.Vehicle_License"
cmd.CommandText += "tblPaymentsAndOthers.Credit_Card, tblPaymentsAndOthers.Debit_Card"
cmd.CommandText += "tblPaymentsAndOthers.Others, tblPaymentsAndOthers.Sub_Total, tblBanking.Maybank_Balance"
cmd.CommandText += "tblBanking.Maybank_Withdraw, tblBanking.Maybank_Deposit, tblBanking.CIMB_Balance"
cmd.CommandText += "tblBanking.CIMB_Withdraw, tblBanking.CIMB_Deposit, tblBanking.Public_Bank_Balance"
cmd.CommandText += "tblBanking.Public_Bank_Withdraw, tblBanking.Public_Bank_Deposit"
cmd.CommandText += "tblBanking.Other_Bank_Balance, tblBanking.Other_Bank_Withdraw, tblBanking.Other_Bank_Deposit"
cmd.CommandText += "tblExpenses.Allowance, tblExpenses.Total, tblExpenses.Wallet"
cmd.CommandText += "FROM tblExpenses, tblFoodAndBeverage, tblHousing, tblTransportation, tblEntertainment"
cmd.CommandText += "tblPersonalCareAndItems, tblPaymentsAndOthers, tblLoan, tblLegal, tblBanking)"
cmd.CommandText += "WHERE tblExpenses.Food_And_Beverage = tblFoodAndBeverage.Food_And_BeverageID"
cmd.CommandText += "AND tblExpenses.Housing = tblHousing.HousingID"
cmd.CommandText += "AND tblExpenses.Transportation = tblTransportation.TransportationID"
cmd.CommandText += "AND tblExpenses.Entertainment = tblEntertainment.EntertainmentID"
cmd.CommandText += "AND tblExpenses.Personal_Care_And_Items = tblPersonalCareAndItems.Personal_Care_And_ItemsID"
cmd.CommandText += "AND tblExpenses.Loan = tblLoan.LoanID"
cmd.CommandText += "AND tblExpenses.Legal = tblLegal.LegalID"
cmd.CommandText += "AND tblExpenses.Payments_And_Others = tblPaymentsAndOthers.Payments_And_OthersID"
cmd.CommandText += "AND tblExpenses.Banking =tblBanking.BankingID"
cmd.Connection = connection
da.SelectCommand = cmd
da.Fill(ds, "tblExpenses", "tblFoodAndBeverage", "tblHousing", "tblTransportation", )
For Me.i = 0 To ds.Tables("tblFoodAndBeverage").Rows.Count - 1
txtBreakFeast.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(0)
txtLunch.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(1)
txtDinner.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(2)
txtSupper.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(3)
txtSnack.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(4)
txtBeverage.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(5)
txtGroceries.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(6)
txtSubFnB.Text = ds.Tables("tblFoodAndBeverage").Rows(i).Item(7)
Next
End Sub
I am having problem with the da.fill-with multiple tables(giving me error)
|
|
|
|
|
garyu87 wrote: I am having problem with the da.fill-with multiple tables(giving me error)
If you encounter an exception, then please, post the entire message. It helps in finding the cause of the problem.
In this case, it's probably caused by a malformed Sql-statement. Take a look at the concatenation;
cmd.CommandText = "SELECT tblExpenses.Date, tblFoodAndBeverage.Breakfast, tblFoodAndBeverage.Lunch"
cmd.CommandText += "tblFoodAndBeverage.Dinner, tblFoodAndBeverage.Snack, tblFoodAndBeverage.Beverage"
That would result in the string below;
"SELECT tblExpenses.Date, tblFoodAndBeverage.Breakfast, tblFoodAndBeverage.LunchtblFoodAndBeverage.Dinner, tblFoodAndBeverage.Snack, tblFoodAndBeverage.Beverage"
Can you see the problem? Those two items should be separated by a comma. I recommend putting the Sql-statement in a separate textfile, and to use File.ReadAllText to load it into the CommandText. That way you can write your Sql-statement in the Management Studio, and simply save it when you're done - and there's the benefit of not having to concatenate a lot if you save it in an external file. Third advantage is that you can update your Sql without a recompile
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I see...thanks for the tip but the compiler does not show any error.
My main problem is here:
da.Fill(ds, "tblExpenses", "tblFoodAndBeverage", "tblHousing", "tblTransportation")
Where there is 5 errors:
1. Value of type'system.data.dataset' cannot be converted into integer
2. Value of type 'String' cannot be converted to 'system.data.datatable'
3,4,5. Same as 3.
|
|
|
|
|
garyu87 wrote: Where there is 5 errors:
Those are the compiler-errors, and they tell what's wrong
A data-adapter has four overloads[^], none of which have that many strings.
Like I said, not much experience with table-adapters and data-adapters; it seems like you want to load multiple tables into a dataset; but the result of the select-query would be a single table, not multiple.
MSDN has a page[^] on the adapter-topic, which includes some examples - those might help
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
Okay thanks for the info now I am calling the data one by one.
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi All,
I'm new to Visual Basic
My question is: When i tried to execute the EXE in vb6 it is getting error as 'Run-time 430: class doesnot support automation or does not support expected interface'
I'm using Microsoft.Jet.OLEDB.4.0 in my component. I'm calling component from vb6, my component is made com visible.
I've tried googled for hours, but could not find solution to my problem .
Also i didnot register my component with regsvr32, but it is visible in COM.
Please help me out from this.
Also please explain why this problem has occured.
OS: Windows 7
Component developed on Visual Studio 2010
Please help me out.
Thanks,
|
|
|
|
|
Karthik Reddy wrote: I'm new to Visual Basic
Welcome to the wondrous world of programming! Now, uninstall VB6 and install VB.NET; VB6 has been developed a long time ago, and targeted a Windows-version prior to Win7. VB6 is no longer sold, no longer supported. VB.NET on the other hand, has a growing community, and it is free.
Karthik Reddy wrote: I've tried googled for hours, but could not find solution to my problem .
Because VB6 is not only old, it's actively being abandoned. If you "insist" on using VB6, then your best source of information are old second-hand books.
Karthik Reddy wrote: OS: Windows 7
Component developed on Visual Studio 2010
If you want to use a .NET control in your VB6-app, you'd best use the VB6 interop toolkit[^]. Contains a complete walkthrough and examples.
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
I also dont want to use this Visual Basic, but client wants to develop app in vb6
let me know if you have an answer to this ...
By the way, thanks for the instant reply
|
|
|
|
|
Karthik Reddy wrote: I also dont want to use this Visual Basic, but client wants to develop app in vb6
Since when do clients dictate which language we use? Does your client know the implications of this choice? Do they understand that there will be almost zero support?
If the client tells you that "strings" are bad, would you try to create a program that doesn't use strings?
Karthik Reddy wrote: let me know if you have an answer to this .
It's a generic error, and usually it includes the classname. It'll be caused by "any" of the components not being registered correctly, with MDAC being the prime suspect. You'd need to install the exact same version of the libraries that you developed against.
Hence the pointer to the VB6-Toolkit from Microsoft; it also explains what needs to be deployed and how, and the most common pitfalls. It's free to download, and it's created to help with mixing VB/.NET.
And again; if you are using .NET already, you'd have the dependency anyway. Why not write the whole thing in a modern language?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
The client has asked in vb6, if we guys develop in VB.NET then there is no point that we are serving the clients with their requirements.
And i don't understand that what should be the best version of MDAC to be installed on the machine. I've the latest 2.8.
Mr.Eddy Vluggen I can see my component in COM, still do I need to register my component with 'regsvr32' ?
|
|
|
|
|