|
Member 15109325 wrote: I can't grasp how I can copy this project to my laptop and it works perfectly
Two possibilities.
First the environment is different. Different OS, different libraries, different permissions, etc.
Second the data is different. You are running with a dataset X. But the problem occurs with dataset Y.
Member 15109325 wrote: AND the exact same SUB is used on 2 other forms without incidence.
That is explained easily - the data is different. Look at the differences and see how the code handles each.
|
|
|
|
|
Are you doing any threading or Tasks?
|
|
|
|
|
Years ago, I wrote a VB6 App to add creation date to certain Outlook items. Now, I don't even know how to access Outlook folders via VB.NET. A complete code sample to run through the Outlook folders would be much appreciated.
Thanks.
Marvin
|
|
|
|
|
|
Thank you for your response, but it does not satisfy my issue. I want to create a VB.Net app, not a VBA routine. I have tried the code snippets you have suggested, but continue to get errors when trying to run it in Visual Studio. Any further suggetions would be appreciated.
Marvin
|
|
|
|
|
|
Again, thanks for the reply. I see no reference to where the code should be copied. I want to create a Windows Form App with VB.net. When I place the code into the "View Code" area, I get multiple errors.
I guess I need additional help.
Marvin
|
|
|
|
|
I have no idea what you are doing or what errors you are seeing, so these suggestions may, or may not, help. If I assume you are using Visual Studio 2022, you first need to create a Windows Forms application using the VB.NET and .NET Framework workload. You should then see the names of your project files in the Solution Explore window. Open the Form1.vb file (you may need to right click on the name and select "View Code"), which should give you an editor view of the generated code. You should now be able to see where the different parts of the code can be inserted.
|
|
|
|
|
You could use this code:
Imports Microsoft.office.Interop.Outlook
Public class CLASS_NAME
Public App As OutlookApplication
Public Sub new()
App = new ( App.getType())
End Sub
End Class
|
|
|
|
|
Simple question for experienced and sympathetic VB.Net developers.
I'm a senior citizen and I haven't really done much Dev for a long time (15yrs) but have occasionally worked on VS12 with VB.Net. I am NOT a trained/schooled developer...mostly self taught to do enough to get by in my own work. My dev is for me only, I don't build with pro teams or any product for sale. It's just to handle MY databases and other app needs.
Looking at the various VS platforms from VS17 thru VS22 I am torn on which way to go as I don't need to be overwhelmed by a steep learning curve just to connect to Access-Office 365 and import/export, manage/report data.
I would appreciate general recommendation before I d/l & install something that intimidates or scares the hell out of me. I'm leaning towards VS17 but could be persuaded otherwise. Please be gentle
I appreciate your responses, thank you.
|
|
|
|
|
If you are going for Visual Studio then choose the latest version: VS 2022. The free community version is quite user friendly. Like you I am a senior citizen and my development is largely just for my own amusement. And if you are only doing VB.NET development you only need to install the .NET and VB.NET workloads.
|
|
|
|
|
You might want to verify the Requirements for VS 2022. Google for following. Don't worry about 'suggested', just look at minimum.
visual studio 2022 requirements
Before doing anything you might want to take a look at the docs/examples for Office 365. If you did MS Access programming in the past I suspect you are going to find that this (365) will be significantly different. But I haven't looked at it in depth.
|
|
|
|
|
I use Visual Studio 2010. I recommend building a library of books such as Professional Visual Studio 2010, Programming Microsoft ado.net 2.0, Microsoft's SQL server 2008 T-SQL Fundamentals. install SQL server and ssms. ask the pilot how to write the functions you need.
ramsey
|
|
|
|
|
I'm confused, why would I go backwards if I've already been developing apps with VS 2012 that are integrated with Access (accdb) Office 365? What am I missing here?
|
|
|
|
|
He's just mentioning that he uses 2010. I think his main point is about developing a collection of books.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
new one(latest) is the best,
use VS2022
|
|
|
|
|
Hi,
I am looking for a solution to transfer my mysql data into
tally using vb6.
please help me.
|
|
|
|
|
Google for "Tally import data VB6" and you'll find that you have to export your MySQL data into an XML format that is Tally compliant. Once you have those file(s), Tally can import those file(s) directly.
Don't even think of asking for code. VB6 has been dead for over 20 years now and I have never used Tally, nor will I ever.
|
|
|
|
|
I would want to prompt user to select a tool name from combobox1, then out automatically, combobox2 gets filled with tool description and size, which is a column in the selected table. Currently i have been using the following code, however the problem comes when i would like to update the database and add another table. This would mean adding the code in the application as well. I would like the application to be able to detect that a new tool table has been added and show that automatically without having to code again
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' ADDING TABLE NAMES TO COMBOBOX 1 (TOOL NAME)
con.Open()
Dim schemaTable As DataTable = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, New Object() {Nothing, Nothing, Nothing, "TABLE"})
For Each dr As DataRow In schemaTable.Rows
Combobox1.Items.Add(dr.Item("TABLE_NAME"))
Next
End Sub
Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles Combobox1.SelectedIndexChanged
'FILLING COMBOBOX 2 (TOOL DESCRIPTION AND SIZE) DEPENDING ON SELECTION IN COMBOBOX 1 (TOOL NAME)
If Combobox1.SelectedIndex = 1 Then
Combobox2.Text = ""
con.Open()
Combobox2.Items.Clear()
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
cmd.CommandText = "Select * from 14_POUND_HAMMER"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
Combobox2.Items.Add(dr.GetString(1))
End While
dr.Close()
con.Close()
ElseIf Combobox1.SelectedIndex = 2 Then
Combobox2.Text = ""
con.Open()
Combobox2.Items.Clear()
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
cmd.CommandText = "Select * from 3_QUARTER_IMPACT_WRENCH"
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
Combobox2.Items.Add(dr.GetString(0))
End While
dr.Close()
con.Close()
ElseIf Combobox1.SelectedIndex = 3 Then
Combobox2.Text = ""
con.Open()
Combobox2.Items.Clear()
Dim dr As OleDbDataReader
Dim cmd As New OleDbCommand
cmd.CommandText = "Select * from ABRASIVE_CUT_OFF_SAW "
cmd.Connection = con
dr = cmd.ExecuteReader
While dr.Read
Combobox2.Items.Add(dr.GetString(0))
End While
dr.Close()
con.Close()
|
|
|
|
|
Whay are you using manual code to fill the comboboxes? Use DataAdapters and DataBinding and the framework will do it for you. You can also set triggers on the database so you get notified when a new product is added.
|
|
|
|
|
Lots of problems here.
Kudzanai Victor wrote: Select * from ABRASIVE_CUT_OFF_SAW
Problem 1 (most serious): The name of the tool should be kept IN a database column. It should NOT be a table.
Design you are looking for is likely like this
Table: Tool
Columns: Id, Name, Description
Table: Tool_Attribute
Columns: Tool_Id, Name, Description
If you need more detail for Attribute you might add one or two more columns. If more detail than that is added then you might need an additional third table.
Once you do the above then getting a list of all tools consists of querying the first table. This includes name, description AND the id.
Then detail for a single tool is gotten by using the id from the above list.
------------------------------------------
Kudzanai Victor wrote: Select * from ABRASIVE_CUT_OFF_SAW
Problem 2: Don't use the asterisk.
Rather explicitly name the columns that you want to retrieve.
|
|
|
|
|
I have a SQLite DB attached to a VB.Net app. I have about two years of data I would like to not loose.
So with DB Browser I can change the two fields from TEXT to INTEGER.
Then make necessary changes in the code to reflect the changes in the DB.
Below are the variables that are declared in a Data Module used for searching
Public gvYear As String
Public gvFromMonth As Integer
Public gvToMonth As Integer
Only change here gvYear will become an Integer
Here is the code that created the original DB
Public Sub makeTxData()
'create table TxDataTable String for cmd
Dim create_table As String = String.Empty
create_table = "CREATE TABLE IF NOT EXISTS TxData(
TID INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
txSortDate TEXT,
txYear TEXT,
txType TEXT,
txAmount TEXT,
txCKNum TEXT,
txDesc TEXT,
txBalance TEXT,
txSearchMonth TEXT)"
Dim dbTable As String = "TxDataTable"
Changes here txYear and txSearchMonth will be INTEGERS txSearchMonth int that reflects month of year
Steps for Process
Copy DB and Paste DB in another folder
Make Changes to Code that creates the DB
Make Changes in the DB manually with DB Browser
Uninstall the app and make new exe file with Inno Setup with new GUID
Create the new DB and delete the DB that is created then Paste the OLD DB in the new app version
I am sure I am overlooking something here so I guess the question is
Will this work ?
Is there a better way to accomplish this ?
Because this is a Check Book app I hate to loose the data.
What are the risks of this happening ?
|
|
|
|
|
My suggestion would be to write a converter. Create a new database with a similar table but all the data items stored as the correct types: INT for numbers, TEXT for strigs, and you could even use the DATE type for dates (See Date And Time Functions[^]).
The converter application would then read all the records of the old database, convert their content to the correct data types, and write the new records to a new database. You then run your modified app against the new database and reconcile the details against the old one.
|
|
|
|
|
After discovering I can not change the DB schema with DB Browser
Your suggestion of writing a converter is the only option
Thanks for the link about Date & Time Function
Wonder if anyone has written a Open Source SQLite DB Converter time to search
|
|
|
|
|
It's only a few lines of code:
- read next record
- convert data types
- write new record
|
|
|
|