|
Try going into your project properties and change the build Target CPU to x86. If your library is 32-bit only (most are!) you cannot compile your code as AnyCPU as that will make your code run as 64-bit on a 64-bit machine and 32-bit on a 32-bit machine.
You cannot mix 32- and 64-bit code in the same process.
|
|
|
|
|
hI my name is vishal. I building vb6 application with ms access using adodb. I have a form which contains label,combobox and 2 buttons.The form loads required data that I use when combobox is clicked.But given below is line where I am getting errors. The query below I take from 4 tables.
table1: name:Inward
Column Name DataType
mfr_ref_number Text
no_of_bundle Integer
supplier_id Integer
DC_date Date/Time
INV_date Date/Time
row_upd_date Date/Time
courier_name Text
inward_type Text
user_id Long(contains values 0 for all)
DC_NO Text
closed_status Boolean(true for some agn only)
to_dept Text
agn Long
table2:name:item_mater
Column Name DataType
user_id Long(contains 0 as value for all)
row_upd_date Date/Time
status Boolean
item_name Text
item_parent Long
item_price Double
item_desc1 Memo
item_desc2 Memo
item_desc3 Memo
item_type Long
item_code Text
agn Long
measure_type Text
table3:name: Stock_Register
Column Name DataType
row_upd_date Date/Time
technician_id Long
user_id Long(contains 0 as value for all entries)
in_out_type Integer
status Boolean
item_id Long
qty_debit Double
qty_credit Double
in_out_id Long
store_no Long
sl_no Text
ref_id Long
table4:name:store_master
ColumnName DataType
rack_name Text
rack_desc Memo
user_id Long(contains 0 as value for all entries)
row_upd_date Date/Time
status Boolean
store_no Long
I have to show agn field from table named Inward,item_name field from table named item_master,no_of_bundle field from table named Inward,rack_name field from table named store_master,store_no field from table named store_master.
When I tried the below query I get message that datas are not found for any agn. But in fact there are datas for agn I just need to check with another table named Stock_Register. i have tried query below:
SELECT [Inward].[agn], [item_master].[item_name], [Inward].[no_of_bundle], [store_master].[rack_name], [store_master].[store_no]
FROM (Inward INNER JOIN store_master ON [Inward].[store_no]=[store_master].[store_no]) INNER JOIN item_master ON [store_master].[user_id]=[item_master].[user_id]
WHERE [item_master].[status]=True And [Inward].[deleted_status]=False And [Inward].[closed_status]=False And [Inward].[agn]<>0 And [store_master].[status]=True;
Can anyone help me guide in fixing my sql select query using joins.Any help or guidance would be greatly appreciated.
|
|
|
|
|
This has nothing to do with VB or VB.NET. This is entirely a SQL question. Ask this in the Databases section.
|
|
|
|
|
1. See Dave's comments.
2. VB6 is no longer supported; no new development should be done in VB6 unless no other option exists
3. See Dave's comments.
|
|
|
|
|
Member 10248768 wrote: I building vb6 application
Then you are an idiot - download VB.net express. While there may be some justification in maintaining VB6 there is absolutely no reason to be building a project using a language that has not been supported for more than a DEACADE!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
Ho interesting stuff, I did not think there were... no I'll just shut up now. However I did add some commentary to Colin's response!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
The fact that Latin is not extinct does not mean that we should write manuals in it.
It is an unsupported language - all those open source projects might stop working tomorrow due to some windows-update. People will be whining about Microsoft, while they've had more then ten years to migrate.
It's as much as a feasable target for development as the Atari ST environment; while there still may be some enthousiast playing with it, we do not consider them to be 'active' platforms.
VB6 is not pinin' - it is bereft of life, it has ceased to be, it is an ex-language.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
I have multiple combobox which pulls all its information from several sql tables. The records are being populated but unable to insert into a sql table (tran_log) once data's are selected. I found a scripts which prompts me that I have a successful connection to my DB and that an insert has been made but the records are not being updated. I tried 2 different scripts but still no luck. Also, I get an error regarding objcmd.ExecuteNonQuery() from both scripts that's why its commented. Thanks!
Script 1:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim acsconn As OleDbConnection = New OleDbConnection _
("provider=SQLOLEDB;data source=DBserver;database=myDB;user ID=user;password=mypassword;")
acsconn.Open()
If acsconn.State = ConnectionState.Open Then
MsgBox("Connected")
Dim strsql As String = "insert into tran_log(hw_name,[type],[status],wh_function,[user],check_out_date)values(?,?,?,?,?,?);"
Dim objcmd As New System.Data.OleDb.OleDbCommand(strsql, acsconn) ' the oledbcommand
With objcmd
.Parameters.AddWithValue("@ComboBox1", ComboBox1.SelectedItem)
.Parameters.AddWithValue("@TextBox1", TextBox1.SelectedText)
.Parameters.AddWithValue("@ComboBox2", ComboBox2.SelectedItem)
.Parameters.AddWithValue("@ComboBox3", ComboBox3.SelectedItem)
.Parameters.AddWithValue("@ComboBox4", ComboBox4.SelectedItem)
.Parameters.AddWithValue("@DateTimePicker1", DateTimePicker1)
End With
Try
objcmd.Connection.Open()
Dim rowsAffected As Integer = objcmd.ExecuteNonQuery()
Console.WriteLine("RowsAffected: {0}", rowsAffected)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
'objcmd.ExecuteNonQuery()
objcmd.Dispose()
MsgBox("Saved")
End If
acsconn.Close()
End Sub
Script 2:
Dim strcom1 As String = ComboBox1.SelectedText
Dim strcom2 As String = TextBox1.SelectedText
Dim strcom3 As String = ComboBox2.SelectedText
Dim strcom4 As String = ComboBox3.SelectedText
Dim strcom5 As String = ComboBox4.SelectedText
Dim strcom6 As New DateTimePicker()
Dim objconnection As OleDb.OleDbConnection = Nothing
Dim objcmd As OleDb.OleDbCommand = Nothing
Dim strconnection As String, strSQL As String
strconnection = "provider=SQLOLEDB;data source=DBserver;database=myDB;user ID=user;password=mypassword;"
objconnection = New OleDb.OleDbConnection(strconnection)
objconnection.ConnectionString = strconnection
objconnection.Open()
strSQL = "insert into tran_log(hw_name,[type],[status],wh_function,[user],check_out_date)values(@ComboBox1,@TextBox1,@ComboBox2,@ComboBox3,@ComboBox4,@DateTimePicker);"
objcmd = New OleDb.OleDbCommand(strSQL, objconnection)
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox1", strcom1))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@TextBox1", strcom2))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox2", strcom3))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox3", strcom4))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ComboBox4", strcom5))
objcmd.Parameters.Add(New System.Data.OleDb.OleDbParameter("@DateTimePicker", strcom6))
objconnection.Close()
MessageBox.Show("Entered Successfully!")
|
|
|
|
|
Gentry_38 wrote: Also, I get an error regarding objcmd.ExecuteNonQuery() from both scripts that's why its commented.
If you don't execute the command, then it's no surprise that the command won't be executed, and your database won't be updated!
You need to call the ExecuteNonQuery method, so concentrate on fixing the error. If you can't fix it yourself, post the details of the error here and someone will probably be able to help you with it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I removed the comment got the error "Invalid character value for cast specification".
|
|
|
|
|
Then one of the values you're trying to insert is not valid for the column you're trying to insert it into. Debug your code, inspect the values of the parameters, and compare them to the data types of the relevant columns.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Figured it out. Just had to change the value to .Text. Thanks for your help!
Dim strcom1 As String = ComboBox1.Text
Dim strcom2 As String = TextBox1.Text
Dim strcom3 As String = ComboBox2.Text
Dim strcom4 As String = ComboBox3.Text
Dim strcom5 As String = ComboBox4.Text
Dim strcom6 As DateTime = DateTimePicker1.Value
|
|
|
|
|
I have two options. When option single is checked, Iwant to show a openfiledialog and read it contents and save it in database as Byte.
When the option multiple is clicked, Want to open a folderbrowserdialog, want to read all files and its contents and save it in the database. How to acheive this??
|
|
|
|
|
In option 1 you just read the file whose path is returned from the OpenFileDialog, and write the data as required. In option 2 you set a loop and iterate over all the files in the selected folder, doing the same for each file. It is unlikely that you would want to save each file's content in the database, unless they are fairly small files, or you have unlimited disk space in your database. A possible solution is to write the file contents in some other folder, and save their locations in the database. What exactly is the problem in implementing this?
Veni, vidi, abiit domum
|
|
|
|
|
hi my my name is vishal.i am exporting vb6 data to PDF using sql select query from multiple tables.. My form is loads appropriate agn numbers. However here is line below where i get error saying:item cannot be found in the collection corresponding to the requested name or ordinal.
given below is line in sql select query where i get error:
MDIForm1.loadReportinPDF "select iw.agn,ih.item_name,iw.no_of_bundle,sw.rack_name,sw.store_no from Inward iw,item_master ih,store_master sw where iw.deleted_status=ih.deleted_status", "STOCK PURCHASE-SAMPLE"
Can anyone point out how should i fix this problem.Can anyone help me please.Any help would be greatly appreciated.
|
|
|
|
|
That error usually means that you have a spelling mistake in one of the column names in the query
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Firstly thank you for replying on such short notice Mam/Sir i have checked my column names and i have typed correctly in sql select query.I will given you structure of my 3 tables(Inward,item_master,store_master) given below:
table name:Inward
Field Name DataType
mfr_ref_number Text
no_of_bundle Integer
supplier_id Integer
DC_date Date/Time
INV_date Date/Time
row_upd_date Date/Time
courier_name Text
inward_type Text
user_id Long Integer
deleted_status Yes/No
deleted_date Date/Time
DC_NO Text
closed_status Yes/No
closed_date Date/Time
store_no Long Integer
to_dept Text
agn AutoNumber
table name:item_master
Field Name DataType
user_id Long Integer
row_upd_date Date/Time
deleted_status Yes/No
status Yes/No
item_name Text
item_parent Long Integer
item_price Double
item_desc2 Memo
item_desc1 Memo
item_desc3 Memo
item_type Long Integer
item_code Text
agn AutoNumber
measure_type Text
table name:store_master
Field Name DataType
rack_name Text
rack_desc Memo
user_id Long Integer
row_upd_date Date/Time
status Yes/No
store_no AutoNumber
Sir above i have posted the structure of my 3 tables.Tell me or guide me,correct me where i am going wrong in the sql select query? Reply please.
|
|
|
|
|
Creating tables in Access using the above definitions, and running your query after cutting and pasting, it works first time.
I am confused, however by the fact you have no joins between the tables in the query, and by how the tables are related.
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
Hi All!
Hello all!
It’s been awhile and I’m back with another odd ball application.
I’ve never played much with Visual Studio 2013 and DOS. I’m starting with a plane-Jane form, nothing special.
I have a need to create an application that will use DOS. I know, DOS! Yes. It’s still used very widely.
What I need to do is:
1.) Have text box where I can enter a server IP
2.) Have a text box where I can enter a time in minutes. This Text box will be controlling a Timer function.
3.) Have a check box that will enable the timer
4.) Have a start button that will start the timer (based on the contents in the text box for time)
5.) A stop button to Stop the Timer cycle
6.) And finally a TEST button
What does this all do? Pings a server of the IP I entered into text box 1.
I’m working with a remote router that likes to fall asleep. Boss wants me to come up with a way we can enter the router’s IP addy, select a time in minutes and “Ping” this thing ever so many minutes.
I’ve included the form layout and am not sure exactly where to start. I’d like a text box to display the results of the ping when I click the test button as well.
So, I guess the first task is:
How can one enter an IP addy into a text box and tell DOS to Ping that IP addy and display that result in a text box?
Please let me know if this is not the right forum, it’s been a few years since I’ve been on here. Any help will be greatly appreciated.
Thanks in advance, these forums have helped me in some very odd ball projects in the past. I’d like to work through the entire project on here in this thread. Things discovered in this project could really be helpful to others.
Thanks,
-Chris
|
|
|
|
|
I'm assuming the reference to DOS is simply because you want to execute the ping command, which runs in a command-prompt?
If so, you can use the System.Net.NetworkInformation.Ping class[^] to achieve the same result.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard-
Yes! I'm needed to execute the ping command that rins in the command prompt from the IP addy I input into text box 1. I also want the out put of this to be displayed in a multiline text box.
Been all over searching and finding I'm getting more confused then I'm getting answers.
Thank you so much for the help!
-chris
|
|
|
|
|
Member 10570421 wrote: How can one enter an IP addy into a text box and tell DOS to Ping that IP addy and display that result in a text box? Look at Process.Start[^].
Member 10570421 wrote: Things discovered in this project could really be helpful to others. That's why there's the example on MSDN.
Adding the textboxes to get the params for the command should not be that hard
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
You're not doing anything in DOS. DOS has been dead for a long time now. What you're talking about is a command prompt which provides an interface that LOOKS like DOS and behaves somewhat like it.
The type of application you're talking about is a Windows Forms application, that has nothing to do with "DOS". You don't need to execute PING on a command prompt at all. Ping functionality can be found in the My namespace, under My.Computer.Network.Ping(...) . You don't need to shell out to the command-line version of PING at all.
My.Computer.Network.Ping()[^] docs.
|
|
|
|
|
Hi everybody, I had a big problem in my code using timer in DataGridView. When I load my program and starting navigate automatically using timer in DatagridView it doesn't no problem. Then, a second time around I refresh my datagridview to start again the timer. My Timer doesn't work as what it did when i first load my program to run my timer in datagridview. Any idea how to fix my problem.
I have the following code.
Private Sub Timer3_Tick(sender As Object, e As EventArgs) Handles Timer3.Tick
Dim name As String
Dim number As String
If i < TblContactsDataGridView.Rows.Count - 1 Then
Me.TblContactsBindingSource.MoveNext()
i = i + 1
TblContactsDataGridView.Rows(i - 1).DefaultCellStyle.BackColor = Color.White
TblContactsDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.Blue
name = Me.TblContactsDataGridView.Rows(i).Cells(0).Value.ToString()
number = Me.TblContactsDataGridView.Rows(i).Cells(1).Value.ToString()
Me.TblContactsDataGridView.ClearSelection()
Me.TblContactsDataGridView.Rows(i).DefaultCellStyle.BackColor = Color.LimeGreen
Try
If objclsSMS.sendMsg(Me.port, number, txtMessage.Text) Then
Me.lblStatus.Text = "Message has sent successfully"
Me.lblStatus.Text = "Failed to send message"
End If
Catch ex As Exception
End Try
Else
Dim a As Integer
a = Me.TblContactsBindingSource.Count()
lblStatus.Text = "Message has sent successfully to " & a & " contacts"
Me.DbSMSDataSet.Clear()
End If
End sub
Thanks in advance.
|
|
|
|