|
you need to set a returnValue parameter (where the function result will be
stored) and execute as "ExecuteNonQuery"
Ishak
|
|
|
|
|
Here is a differente way to prepare the calling to the stored function:
Public Sub ADD_NEW_ITEM(ByVal ConnectionString As String _
, ByRef ITEM_ID_O As Integer _
, ByVal V_ITEM As String)
Dim oConn As New OracleClient.OracleConnection(ConnectionString)
Dim rtnVal As New OracleClient.OracleParameter("", Conn)
Dim inpVal As New OracleClient.OracleParameter("", Conn)
Dim outVal As New OracleClient.OracleParameter("", Conn)
Dim oraCmd As New OracleClient.OracleCommand("MY_PCKG.ADD_NEW_ITEM", oConn)
oraCmd.CommandType = CommandType.StoredProcedure
outVal = oraCmd.CreateParameter
outVal.ParameterName = "ITEM_ID_O"
outVal.OracleType = OracleType.Number
outVal.Direction = ParameterDirection.Output
outVal.Value = DBNull.Value
oraCmd.Parameters.Add(outVal)
inpVal = oraCmd.CreateParameter
inpVal.ParameterName = "V_ITEM"
inpVal.OracleType = OracleType.VarChar
inpVal.Size = 2000
inpVal.Direction = ParameterDirection.Input
inpVal.Value = V_ITEM
oraCmd.Parameters.Add(inpVal)
Try
oConn.Open()
rtnVal.Direction = ParameterDirection.ReturnValue
rtnVal.OracleType = OracleType.Number
rtnVal.ParameterName = "ITEM_ID"
rtnVal.Value = oraCmd.ExecuteNonQuery
oraCmd.ExecuteNonQuery()
Catch
MsgBox(Err.Description)
Finally
oraCmd.Dispose()
oConn.Close()
End Try
End Sub
So I get the same results.
Thanks for your answer, do you have some other idea ?
|
|
|
|
|
what is wrong with this code. I am trying to create a shortcut that is displayed on the desk top.
this is in the declarations of the form
Private Declare Function fCreateShellLink Lib "STKIT432.DLL" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArgs As String) As Long
This is in the form command click
Private Sub Command1_Click()
Dim lRETURN As Long
lRETURN = fCreateShellLink("C\documents and settings\administrator\desktop", "Shortcut to logbook", "c:\drags\logbookv10.exe", "")
End Sub
The results are:: NOTHING, NOTHING, NOTHING
What is wrong??????????????????????????????
|
|
|
|
|
Are you using VB5? STKIT432.DLL was replaced a long time ago with an updated one. But, you don't even need that one either.
If you're using VB6, use the Windows Scripting Library (set a reference to this) WshShell object and its CreateShortcut method to create the shortcut.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using vb4
|
|
|
|
|
Why? It's 10 years old! There's no support for it anymore. If you want to support the O/S's of today, you'll have to upgrade!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
In VB.NET 2003, with a listview in large icon view, I need to allow the user to manually rearrange the icons using the mouse. Kind of like a DragDrop operation but not.
I tried all the prop setting for the listview but nada!
A good example would be Windows Explorer in Icons View, set to autoarrange. You can still have them all lined up but you can manually drag and re-arrange the icons.
What do I need to do to set this up?
Thanks for any help.
|
|
|
|
|
The ListView really doesn't have any support for this. In order to have the items rearrangable and allow the user to place the items anywhere they want, you have to have seperate objects for each item in the list and have each item track it's own position on screen. This tracking is not possible using the normal ListViewItem class.
You'd have to come up with your own ListView class and ListViewItem class, possibly extending the standard classes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
That bites If vb6 was able to do it you think vb.net would support it too but in a complicated way, not lie that though
Any other possible way you can think of?
Thanks
|
|
|
|
|
How did you get it to work in VB6?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here is some demo code for VB6. If you drag an item and drop it anywhere in the listview it will move to that position.
Option Explicit<br />
'Add a ListView to your form (ListView1)<br />
Private Sub Form_Load()<br />
Dim i As Integer<br />
With ListView1<br />
.Arrange = lvwAutoTop<br />
.HideSelection = False<br />
.LabelEdit = lvwManual<br />
.MultiSelect = False<br />
.Sorted = False<br />
.View = lvwIcon<br />
For i = 1 To 50<br />
.ListItems.Add , , i<br />
Next<br />
End With<br />
End Sub
|
|
|
|
|
I have a combo box in a VB 6 form that takes its list items from a Database Table.
when i add a new value in that list on the form by clicking on the add button I put an IF check on the add Button.
That IF check is that if the value is present in the list then it gives the msgbox that the value is already present and else it will add the value in the list of that combo box.
the Coding on the Add Button is:
if txtto.text = cboto. then
msgbox "The value is already present"
else
cboto.Additem txtto.text
end if
my problem is that the first part of the IF check doesnt works and by clicking add button it adds the value to the list. What code should I use in that first part of the IF check that it gets right? What property should i use for combo box to make it work correctly?
Its urgent plz help.
|
|
|
|
|
If your getting your combobox data from a database, then see if the item is in the database. If it isn't, add it, then rebind your combobox.
If you want to compare it against the data in the combobox, you'll have to iterate through the entire list of items in it. You can't do just one compare to see if an item is in the list anywhere. You have to compare against each item in the list until you find it or run out of items.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello,
REF: VB6
I'm having trouble setting a variable NAME....
' set these variables
Const pos1 = 100
Const pos2 = 200
Const pos3 = 300
ID_dog = 1
' set variable position_dog
position_dog = "pos" & ID_dog
the result is...
position_dog = "pos1" <===== NOT what I need
I need the result to be a varible like....
position_dog = pos1 <===== I need this
which of course would be equivalent to position_dog = 100
or.....
if I set ID_dog = 2 then position_dog = 200
if I set ID_dog = 3 then position_dog = 300
any ideas ??
thanks in advance!
---- mike
|
|
|
|
|
mike2k5 wrote:
position_dog = "pos1" <===== NOT what I need
I need the result to be a varible like....
position_dog = pos1 <===== I need this
You can't do that. There's no function to evaluate the contents of a string and come up with a variable name reference. An option would be to select the correct constant to assign using a Select statement
SELECT CASE ID_dog
CASE 1
position_dog = pos1
CASE 2
position_dog = pos2
CASE 3
position_dog = pos3
END SELECT
You'll have to provide more details on what your doing if you need a better solution. What is position_dog and how do these constants and ID_dog relate to it? What's the purpose of this code?
|
|
|
|
|
|
hii..
we are doin a MEDIA on DEMAND project..on a client-server system
well.. now we are using Windows 2000 Advanced Server as OS, and i ll be using MSSQL Server as database...
i would like to know whether we can keeb links (path to the files) in the database and the actual files(the audio, video, text doc, PDFs etc.) somewhere else ?? i mean in different directory on the server machine ??
|
|
|
|
|
|
hi, i am making a program with vb.net and I have a problem. Because I want the program to be registered first. I made a form with the register and another one with the program. You first want to register from the register form and then you can use the program form. I made the startup as the program and i used the stream reader to read from a text file if the user registered the program. if the user registered then he can use the program. when he double click the program the second time he (if he registered) i want to show only the program not the registration form of the program because he already registered. How can i make this!! HELP ME PLS!!!
Adrian
|
|
|
|
|
Your registration form should NOT be your startup form. Your main application form should be. The first thing it does should be to check to see of the app is registered, if not, put up the registration form as a modal dialog (ShowDialog). When the registration form is closed, check again to see if the app is registered. What you do from this point on is up to you, but normally you would setup your application in either a "full functionality" mode or a "restricted mode", depending on the registration status.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Q.1) How can you enable/disable network adapters in VB6? Is their a registry setting I can edit or a function that can do this?
Q.2) How can I create a list in a VB project of all Network adapters(NICs) on my PC.
I have done dozens of google and microsoft searches and found nothing but dead ends. I greatly appriciate your help.
Thank you "The Code Project" community
|
|
|
|
|
The reason you didn't find any VB6 code to specifically do this is because, one, it's not something most people would do, and two, they wouldn't normally use VB6 to do it.
1) There is no registry setting that will do this. This must be done by using the Device Manangement API functions. Definately not for the faint of heart, or those weak in COM skills. If you want to take a look at what's involved, click here[^]. You've been warned...
2) You can do this using Windows Management Instrumentation to get a list of Win32_NetworkAdapter s. For more on using WMI, see here[^]. Oh yeah, you cannot use WMI to disable the network adapter(s)!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks Dave,
I'm not sure if I can handel this job on my own, but I've got to get it done somehow so I'll have to learn it. Thanks for your help.
|
|
|
|
|
Oh! BTW, the Device Management functions will only work under an Administrator account...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|