|
VB is dying quickly. SUpport for it on the 'Net is disappearing by the day as everyone focuses on VB.NET and the .NET Framework.
Also, if you're just starting out programming, controlling a gizmo over a serial port or parallel port is WAY over your head considering that VB6 doesn't have any control over the hardware needed to do this.
You can try to look at http://www.logix4u.net[^], but it's not for beginners...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how to rollback the transaction if network fails
try
ex:
StartTrans()
doing process
.
.
.
.
DB get locked can't do anything how to release the lock if network fails here?
.
.
.
commit trans()
catch e exception
rollback
end try
krish
|
|
|
|
|
if exception will be thrown then the rollback inside the catch statment will be executed.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
yes you'r right.
but the rollback wont work if the network fails even exception throws, coz dont have database server connection.
|
|
|
|
|
Rigth, that is a problem...
I have never faced this situation so I really don't know how to solve this. Maybe somebody else will be able to help you.
--------------------------------------------------------
My development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
My suggestion is to run that part of the db update code as a stored procedure which is called from your program. Place the Begin Transaction ... Commit ... Rollback etc as required in that stored procedure.
That way it is SQL Server's responsibility for the transaction and it doesn't matter if you lose the network connection.
You may also like to investigate the command timeout parameters on your server and/or on your db connection object.
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
Thank you so much Steve
for your kind advise. i will try this method...
|
|
|
|
|
When i click the datagrid i want to list the fields of the selected row in the corresponding textbox,for this wat code i shud write
with regards
rahul
let the noble thought come from every side-Rig Veda
|
|
|
|
|
hi
Dim lBm As BindingManagerBase
Dim lDr As DataRow
lBm = Me.datagridname.BindingContext(Me.datagridname.DataSource, Me.datagridname.DataMember)
lDr = CType(lBm.Current, DataRowView).Row
you can get your value form datarow like this: ldr("fieldname")
raj
|
|
|
|
|
HI all !
I have a problem. I buil a procedure which insert data to Oracle Database. In the procedure I call twice ( 2 times) the StoredProcedure. Both these StoredProcedure aslo using common a Transaction. The first done well but immediately my application was pending ( may be the broken network,...) and I have to restart my application.
But in Oracle Database the data have inserted. Pls, tell me why ? and How can I resolve it. Althought a Transaction in my application didn't commit;
Thank alot
|
|
|
|
|
Without seeing your code, it's impossible to tell you how to fix it.
But, in general, you should put the update code in stored procedures in the database and let it worry about the transaction details.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi!
My code is here ! pls, hekp me
=====================
g_trans = g_Conn.BeginTransaction
Me.g_cmd = New OracleClient.OracleCommand
// The first. I hate to insert the header of bill into BillHeader Table
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_TDPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
..........
.ExecuteNonQuery()
End With
// Then, I have to insert detail each Item into Items Table
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_CTPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
...............
.ExecuteNonQuery()
End With
=========
When both procedures successful, I must commit the Transaction ( g_trans.Commit()). But If have some problem, I have to rollback all (g_trans.Rollback())
|
|
|
|
|
Hi!
My code is here ! pls, help me. Thank alot
=====================
// Then, I have to insert detail each Item into Items Table
For i ....
With g_cmd
.Connection = g_Conn
.Transaction() = g_trans
.CommandType = CommandType.StoredProcedure
.CommandText =
"PKG_NHAP_TBI.SpInsert_CTPhieuNhap"
.Parameters.Clear()
.Parameters.Add("v_soct", soCT).Direction =
ParameterDirection.Input
...............
.ExecuteNonQuery()
End With
Next
=========
When both procedures successful, I must commit the Transaction ( g_trans.Commit()). But If have some problem, I have to rollback all (g_trans.Rollback())
|
|
|
|
|
hello,
can someone teach me how to connect to a database by a manual coding. not the automatic one! I am using an Ms Access 2003. I want to search to the database as well.
Please help me!
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Look at what code Visual Studio is creating for you. You can use that as a starting point. You can then change values on the automatic creation and see what differences that makes to the generated code - you will begin to get an understanding of what you need to do to connect to a database using your own code rather than code that Visual Studio has created for you.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi all,
im doing an application in which im reading an excel file,so i just want to count the number of rows and columns in excel file from the vb program .please help me with this.
with regards,
susa
|
|
|
|
|
Rowcount: numRows = xls.Worksheets(1).usedrange.rows.count
Column Count: colRows = xls.Worksheets(1).usedrange.columns.count
Here, xls is Excel Workbook Object which is declared as
Dim xls as Excel.Workbook
|
|
|
|
|
i added this code but im getting error as property or method not supported
help me
hi to all
with regards,
susa
|
|
|
|
|
Can anybody help me to find a solution that how can i convert a binary file that is saved in the database to a word file in the front end part.
Krishna
|
|
|
|
|
There are more than a few documents on the web that describe this, Google results[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have Visual Studio disk , after i installed it, eveything 's almost ok but when it 's near the end of installation (I think).These stuffs appeared :
First alert box:
ssapi.dll was unable to register itself
in the system registry.
Second alert box:
The instruction at "0xffbadd11" referenced
memory at "0xffbadd11". The memory could
not be "read".
Cick on OK to terminate the program.
and when I click ok , then i can use Visual C++ , but when i try Visual Basic, this alert box appeared:
unexpected erro; quitting
Please explain me what happened and how to solve it. I need Visual Basic, i will learn it this semester.
|
|
|
|
|
Is VB98 VB6 ? If so, you're learning a dead language. You should try to find a course in VB.NET, or another language altogether. VB.NET is free, but you can't use it to do VB6.
Are you running as an admin when doing this install ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Sounds like you are attempting to install on an unsupported/unpatched system or you are using an old version of VB. Which Visual Studio version are you attempting to install and on what system?
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|
|
This is Visual Studio 6.0, and I use Windows Xp Home Edition.
This is the first time I use Visual Studio, can you explain me what difference between Visual Basic, Visual C++ and Visual Sudio.
Sorry for stupiest question.
-- modified at 1:56 Monday 24th April, 2006
|
|
|
|
|
Visual Studio is the "integrated development environment" that provides a consistent look and feel and automates the language compilers. Visual Basic and Visual C++ are programming languages.
VS 6 on XP Home should work ok provided you don't use functions that are not supported on XP Home (e.g. some domain functions or IIS web development).
What you do need is a fully up-to-date patched XP and careful that any prerequisites are installed on your machine.
Also check that the CD you are using is a genuine one and not ripped from somewhere else.
Like Christian said, VB 6.0 is no longer a good choice for development and if you can, use VB.NET instead (Visual Studio 2005 Express is free from Microsoft).
...Steve
1. quod erat demonstrandum
2. "Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." I read that somewhere once
|
|
|
|