Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Pass Array Variables To A Sub Procedure


i have this arrval(1) to arrval(6) and i want to pas the values to asub procedure.how will the call statement be like?ie
call namepro(.....)
and the sub name?ie
private sub manepro(........)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Do I Pass Array In A Procedure
Hi Pals..

   how do i pass array as an argument in a procedure.

For example i have xxx.dll where it has a argument that accepts array of 5.
How do i pass the whole array (not individual ) as an argument in VB.?


Rgds,
Pradeep


 

I Want To Pass Image As An Array To A Procedure
Dears ;
I have a problem in passing image as an array to a procedure or just passing an image to a procedure to save it in SQL using stored procedure. Please , help me out for this.

Regards,
essa2000

How Do I Pass The Name Of An Array To A Function Or Procedure?
Hey i've got bunch of arrays of tick boxes, each array contains somewhere
between 5 and 20.

What I want to do is write a function that returns the captions of every
ticked tick box in an array as a string.

I want to be able to pass to the function the array name, and the lower and
upper limits of the array. But I have no idea how to pass the control name
(array name).

I can do it by writing a prodecure for every single array, but there are
hundreds of them! It must be possible using a single function or procedure.
I came up with this, it needs finishing.

Private Function ReturnString(ctrlName As ***WHAT?????**** , intLow As
Integer, intHigh As Integer) As String
intFlag = 0
strField = ""
For intCount = intLow To intHigh
If ctrlName(intCount).Value = 1 Then
If intFlag = 0 Then
strField = ctrlName(intCount).Caption
intFlag = 1
Else
strField = strField & ", " & ctrlName(intCount).Caption
End If
End If
Next intCount
ReturnString = strField
End Function


Thanks for any help

Steve

How To Pass An Array To Stored Procedure
first of all thanks for all the answers you guys are sending.they are really helping me in my project.here comes another problem.

i have this stored procedure in oracle

CREATE OR REPLACE PROCEDURE VARRAY_TEST
(SUBJECT_IN IN SUBJECT_TYPE)
IS

I NUMBER ;
BEGIN
FOR I IN SUBJECT_IN.FIRST..SUBJECT_IN.LAST LOOP
INSERT INTO empl VALUES(SUBJECT_IN(I));
END LOOP;

END;

where SUBJECT_TYPE is a varray declared using the following statement:

CREATE OR REPLACE TYPE SUBJECT_TYPE AS VARRAY(10) OF VARCHAR2(10);

and empl is a table name that exists in the database.

i want to call this stored procedure from VB ,passing the values to IN Parameter SUBJECT_IN.

how can i do that.

i tried this code :

Private Sub Command4_Click()
Dim passarray(9) As String
Dim cmdarr As New ADODB.Command
Dim pararr As New ADODB.Parameter
Dim i As Integer

For i = 0 To 9
passarray(i) = "maths"
Next i

Set cmdarr = New ADODB.Command
cmdarr.ActiveConnection = goConn
cmdarr.CommandText = "varray_test"
cmdarr.CommandType = adCmdText

Set pararr = New ADODB.Parameter
pararr.Name = "passarray"
pararr.Direction = adParamInput
pararr.Type = adArray
pararr.Size = 10
pararr.Value = passarray

cmdarr.Parameters.Append pararr

cmdarr.Execute

End Sub

but it doesnt work.gives an error message which says " Arguments are of the wrong type,are out of acceptable range,or are in conflict with one another."

please also try to a sample code.

thanks
regards
Sumit Gulati

How To Pass String Array To A C DLL Procedure
Hello,

Does anyone know how to pass string array to a C DLL procedure?
like, int foo(int i, char **argvlist);

I tried to pass the first element of the array Byref, but it didnt work, since VB string is Unicode,
it passes the temporary ANSIC string address to C procedure, all the other strings are lost.

Could anybody tell me how to get around this problem?

Thank you.

Yan

How To Pass An Array To An IN Parameter Of Stored Procedure(of Oracle) When This Stored Procedure Is
first of all thanks for all the answers you guys are sending.they are really helping me in my project.here comes another problem.

i have this stored procedure in oracle

CREATE OR REPLACE PROCEDURE VARRAY_TEST
(SUBJECT_IN IN SUBJECT_TYPE)
IS

I NUMBER ;
BEGIN
FOR I IN SUBJECT_IN.FIRST..SUBJECT_IN.LAST LOOP
INSERT INTO empl VALUES(SUBJECT_IN(I));
END LOOP;

END;

where SUBJECT_TYPE is a varray declared using the following statement:

CREATE OR REPLACE TYPE SUBJECT_TYPE AS VARRAY(10) OF VARCHAR2(10);

and empl is a table name that exists in the database.

i want to call this stored procedure from VB ,passing the values to IN Parameter SUBJECT_IN.

how can i do that.

i tried this code :

Private Sub Command4_Click()
Dim passarray(9) As String
Dim cmdarr As New ADODB.Command
Dim pararr As New ADODB.Parameter
Dim i As Integer

For i = 0 To 9
passarray(i) = "maths"
Next i

Set cmdarr = New ADODB.Command
cmdarr.ActiveConnection = goConn
cmdarr.CommandText = "varray_test"
cmdarr.CommandType = adCmdText

Set pararr = New ADODB.Parameter
pararr.Name = "passarray"
pararr.Direction = adParamInput
pararr.Type = adArray
pararr.Size = 10
pararr.Value = passarray

cmdarr.Parameters.Append pararr

cmdarr.Execute

End Sub

but it doesnt work.gives an error message which says " Arguments are of the wrong type,are out of acceptable range,or are in conflict with one another."

please also try to a sample code.

thanks
regards
Sumit Gulati

Pass Array To Oracle Stored Procedure
Does anyone know how to pass an array to a stored Procedure.
I have an array with values("1","2","3")
I declare it as Variant

I create my Input Paramater and appen it as
Set ParamIn0 = storProc.CreateParameter("MyArray", adArray + adVariant, adParamInput)

if I set the parameter type to anything other than adArray + adVariant I get error messages. With the Type set to what I have above I get to the sp.execute but I get an error. The error.description is empty or"????". The description changes every time I run.

I'm using Active X Data Object 2.5

Does anyone have any suggestions?

How To Pass An Array As In Parameter To A Stored Procedure(in Oracle) From VB.
first of all thanks for all the answers you guys are sending.they are really helping me in my project.here comes another problem.

i have this stored procedure in oracle

CREATE OR REPLACE PROCEDURE VARRAY_TEST
(SUBJECT_IN IN SUBJECT_TYPE)
IS

I NUMBER ;
BEGIN
FOR I IN SUBJECT_IN.FIRST..SUBJECT_IN.LAST LOOP
INSERT INTO empl VALUES(SUBJECT_IN(I));
END LOOP;

END;

where SUBJECT_TYPE is a varray declared using the following statement:

CREATE OR REPLACE TYPE SUBJECT_TYPE AS VARRAY(10) OF VARCHAR2(10);

and empl is a table name that exists in the database.

i want to call this stored procedure from VB ,passing the values to IN Parameter SUBJECT_IN.

how can i do that.

i tried this code :

Private Sub Command4_Click()
Dim passarray(9) As String
Dim cmdarr As New ADODB.Command
Dim pararr As New ADODB.Parameter
Dim i As Integer

For i = 0 To 9
passarray(i) = "maths"
Next i

Set cmdarr = New ADODB.Command
cmdarr.ActiveConnection = goConn
cmdarr.CommandText = "varray_test"
cmdarr.CommandType = adCmdText

Set pararr = New ADODB.Parameter
pararr.Name = "passarray"
pararr.Direction = adParamInput
pararr.Type = adArray
pararr.Size = 10
pararr.Value = passarray

cmdarr.Parameters.Append pararr

cmdarr.Execute

End Sub

but it doesnt work.gives an error message which says " Arguments are of the wrong type,are out of acceptable range,or are in conflict with one another."

please also try to a sample code.

thanks
regards
Sumit Gulati

How Do I Pass/Return A Date And Array Types Of Variables
Hi Anyone

How do I Pass or Return Date and array types of variables to a COM dll

thanks

To Use Global Public Variables Or Get/Let Property To Pass Variables
Hi Guys,
What is the prefer or better option to use to pass variables from one form to the other. Some of the developers in my office told me Global Public variable is the best and I read some of the articles from Microsoft MSDN which suggested using Get/Let. Now I am utterly confused and don't know what to do. I want to learn the correct way. Please help.

Have a Good Day,

Thanks and Cheers,
Lennie

Pass Array To Function-sort-pass Back To Subroutine
Okay, here's the deal.
1. I have an array of 12 elements.
2. In the subroutine this array is Array1.
3. I pass this to a Funtion named
Public Function Primitive_Sort(Array1() as double, Array2() as double, N
as long) as integer.
4. The statement I use in my subroutine is:
Array2() = Primitive_Sort(Array1(), Array2(), N)
I'll come back to this because I know it is part of the problem.
5. In sort function Array2(I)=Array1(I) with a For...Next loop.
I have to keep Array1 intact for another part of the program.
6. Array2 gets sorted. I check it using msgboxes to debug with.
The numbers look good while in the Function after sort.
7. The problem is back at step#4. In the very first Array2() in that statement, it wants a subscript. If I put an I in and put it in a loop, it calls the function N times. If I put a number in, when I reach that element of the array, the element returns zero as the value instead of the value from the sort. What am I doing wrong?

Thanks for any help you can give...

How Do I Call A Sub Procedure From Another Sub Procedure Using Variables?
How do I store a module's name as a string and then concatenate it with the sub procedure name so I can call it from another sub procedure in a different module as detailed below?

I'll try to explain this as simply as possible.

I am creating an add-in with a bunch of toolbars. I want the common subs such as AddToolbartoMenu() and DeleteToolbar() to be contained in one module for the obvious simplicity in making changes. But I want the individual toolbars to each have a module with its create statement and associated macros for its menus and buttons.

My problem is that I have been VERY unsuccessful calling the CreateToolbar() subs in the individual modules. Here is what I am doing:

The CreateToolbar() sub is called from the common sub ShowToolbar(). If the toolbar doesn't exist, it is created first by calling the CreateToolbar() sub, and then made visible.

Sub ShowToolbar(Optional TOOLBAR As String, Optional MODNAME As String)

' TOOLBAR is just the name of the toolbar
' MODNAME is the name of the module it is in

' If toolbar exists toggle display
Dim ComBar As CommandBar

On Error Resume Next
Set ComBar = Application.CommandBars(TOOLBAR)
If Err.Number = 0 Then
ComBar.Visible = Not ComBar.Visible
On Error GoTo 0
Exit Sub
Else
' THIS IS WHAT'S CAUSING THE PROBLEM
Call MODNAME.CreateToolbar(TOOLBAR)
End If
On Error GoTo 0
End Sub

So the command that I'm trying to run when the workbook opens is simply

Call ShowToolbar("Navigation Toolbar", "NavigationToolbar")

However when it runs I get "Invalid Qualifier" referring to the variable MODNAME.

PLEASE, How do I call this procedure with all these variables in it? If I replace the variable name MODNAME with the text itself, it works like this:

CALL NavigationToolbar.Createtoolbar(TOOLBAR)

But if I do this, it won't work still

MODNAME = "NavigationToolbar"
CALL MODNAME.CreateToolbar(TOOLBAR)

I don't want to change the type of MODNAME to VBCodeModule if I don't have to because of the security issues, but if it's the only way I guess I can.

Thank you all in advance

Pass A Form To A Procedure
How do you pass a form to a procedure? (Access)

If tried:
Code:
GetFoo(Me.Form.Name)
GetFoo([TheNameOThatForm])
and other various combinations but to no avail. I get a Type mismatch error.

The sub GetFoo is delcared:

Code:
Sub GetFoo(frm as Form)

Can I Pass A Procedure As A Parameter?
Hello everybody,
Can I pass a procedure as a parameter to a function
in VB6?
Thanks a lot.

rrgw.

Pass A UDT To Procedure Or Function
When one declares a UDT in a module, how do you pass the UDT variable (after the elements have been assigned data) to another procedure or function (even a class object too) ?

Pass A Procedure As Parameter Of A Sub
I need to do something like this:

Sub FOO(SomeProcedure as ?)

- Do Stuff -

Call SomeProcedure

- Do More stuff -

End Sub

Can this be done? If so, how?

Thanks in advance!
randtek

Can You Pass Controls To A Procedure?
I've got 2 forms with the same combobox on each form. (One form is used for data entry, the other for editing records).

There is currently a procedure that populates the combobox on the main form by querying the values from a database table, but nothing yet written for the combobox on the second form.

I figure I should just use the same procedure to load the contents of both comboboxes. Especially since all of my database queries are stored in a module.

The only problem is that the two comboboxes have different names, and are located on different forms. How can I overcome this? Can I send the name of the control I want populated to the procedure?

Pass Paramarray From One Procedure To Another
I've got a procedure that uses a paramarray to contain several integer values. I want to call this procedure from another, which is called from yet another like so...


Code:

Proc1 (call proc2, pass paramarray to proc2) >
Proc2 (call proc3, pass the same paramarray to proc3) >
Proc3 use paramarray


How can I pass the paramarray from proc1 to proc2 to proc3? Possible?

How Do I Pass Variables
HOw do you pass variables to different subs? i thought i knew but i guess i don't. some code of what i have


Code:
Call InputData(sngname, inthours, intwage, sngstatus)

Private Sub InputData(sngname As String, ByVal intnumhours As Single, ByVal intwage As Single, sngstatus As String)

so what did i do wrong

Will SOMEONE Help Me Pass These Variables!!!?
lol
heres the module code:


Code:
Public Sub calculate(Paycheck As Integer, total As Integer, tax As Integer, taxtip As Integer, taxfin As Integer, taxtipfin As Integer)

Dim hourwrk As Integer
Dim hourrate As Integer
Dim tipsenter As Integer

hourwrk = CInt(Val(Form1.txtHrWork.Text))
hourrate = CInt(Val(Form1.txtHrRate.Text))
tipsenter = CInt(Val(Form1.txtTips.Text))

Paycheck = hourwrk * hourrate
total = tipsenter + Paycheck
taxtip = total * 0.3
taxtipfin = total - taxtip
tax = Paycheck * 0.3
taxfin = Paycheck - tax
End Sub

Public Sub clear()
Form1.txtHrWork.Text = ""
Form1.txtHrRate.Text = ""
Form1.txtTips.Text = ""
End Sub

Public Sub display(Paycheck As Integer, total As Integer, tax As Integer, taxtip As Integer, taxfin As Integer, taxtipfin As Integer)

Form1.lstdisplay.AddItem Paycheck & " " & total & " " & tax & " " & taxtip & " " & taxfin & " " & taxtipfin
End Sub
heres the form1/command button code:


Code:
Private Sub Command1_Click()
Call calculate(Paycheck, total, tax, taxtip, taxfin, taxtipfin)
Call display(Paycheck, total, tax, taxtip, taxfin, taxtipfin)
Call clear
End Sub
i knoe the byval thing didnt work.. whats by reference? byref? that didnt turn out blue so im guessing its wrong.. i wouldnt know which one anyways.. i just need to pass them from the sub caluculate to the sub display... anyone know?

How To Pass Variables From VB To VC?
Hello, I'm a beginner in this programming thing, so if anybody can help... anyway, I am trying to pass some variables from VB to VC. I've tried to pass them through the .exe file but it takes abt 5 mins to pass 22 variables. Does anybody know any shorter way?

Cheers.

Pass Control Object To A Procedure
I have a procedure that requires for one of its inputs, a combo box or list control object. I can't seem to figure out how to pass the actual object, I can pass it the name pretty easy, but obviously that won't help.

Code:

MyProcedure(NeedObject as Object, AnotherInput as String, MoreInputs as Integer)
Help a brother out?

Thanks.

How To Pass A NULL Value To A Stored Procedure
I am upgrading the Crystal Report from 6.0 to 9.0 and following problem has been encountered.

My program has a function to let the user to input the date range in order to print out the appropriate records. If no date is entered, all the records will be shown.

For Crystal Report 6, following codes works fine:
CrystalReport1.StoredProcParam(0) = ""

Howerver, after I've re-written the codes for upgrading, no records can be retrieved.

Dim crxParameterField As CRAXDRT.ParameterFieldDefinition
Set crxParameterField = Report.ParameterFields.Item(1)
crxParameterField.EnableNullValue = True
crxParameterField.AddCurrentValue Empty

It seems like an empty string has been passed instead of a NULL value.
I need to pass a NULL value to the parameter with type "datetime" in the stored procedure.

Any idea how can I fix this problem without modifying the stored procedure? Please help!

Pass A Null Value To A Stored Procedure
Hey all!  I'm trying to pass a NULL value to a stored procedure.  I've done it before using variable dim'd as variant but in this case I need to pass a null string variable to an element in an array dimed as string.  Should this be done here or handled in the SP?

CODE'THIS ARRAY WILL HOLD THE VALUES IN THE LABEL
aryIn = Split(txtScanIn, ";")

'THIS ARRAY IS USED BECAUSE WE HAVE TO SPLIT PART OF THE ABOVE ARRAY BECAUSE THE SPN AND REV ARE TOGETHER AAA.BBB WE MUST SPLIT THAT ELEMENT AGAIN TO GET SEPERATE THE AAA AND BBB.

arySPNREV = Split(aryIn(1), ".")
If UBound(arySPNREV) = 0 Then
    ReDim Preserve arySPNREV(UBound(arySPNREV) + 1)
    
    arySPNREV(1) = vbNullString
End If

How To Pass Parameters To Stored Procedure
Hi all

Can anybody tell me how to pass parameters to a SP from ASP code.
This is the code i used which gives error on the last line saying

"The application is using arguments that are of the wrong type, are out of acceptable range, or are in conflict with one another."



set Ocmd=Server.CreateObject("ADODB.Command")
oCmd.ActiveConnection=MSCS
adCmdStoredProc = &H0004
oCmd.CommandType=adCmdStoredProc
oCmd.CommandText="wish_refresh"

wishid = "161"

set param_wishid = oCmd.CreateParameter("Wishid",adInteger,adParamInput,,wishid)
oCmd.Parameters.Append param_wishid





Is this the way to pass parameters ?

Thanks in advance
Venky

Pass Parameter To ORACLE Procedure
Hello

I have problem with passing (IN) parameter to ORACLE procedure.

The parameter declare as VARRAY.

Is any body can help me here ?
Or there is any way to pass (IN) parameter like Array or Collection ?

Thanks for any help.

Pass Data With Variables
I want to pass data between my forms. How do I go about this.

How To Pass Variables ByRef
Here is my problem.

I would like to pass the equivelent of a C pointer in a sub call. The pointer would point to one of several buffers (arrays) where data would be stored.

Here is a little code:



Code:
Public Sub Test(ByVal Number As Byte, ByRef Buffer() As Byte)

Buffer() = Number

End Sub


Public Buffer1(0 To 10) As Byte
Public Buffer2(0 To 10) As Byte



Code:
Private Sub Command1_Click()

Call Test(5, Buffer1(0))
Call Test(6, Buffer2(0))

End Sub
The intent would be to store the value 5 into Buffer1(0) and 6 into Buffer2(0). However, the subroutine "test" would just store the data where it's told to by the passed "pointer".

Thanks,
Fiz

How Do You Pass Variables Between Forms?
I really need help. I tried every thing
Thanks for your time

Public Variables Or Pass 'em?
I am creating a baseball scoring app. As I have it now, when there is an 'end result' (e.g. a hit or an out), I set a variable (curResult) to a number that defines what happened. I then use that (curResult) to determine other things that happen during that at-bat. curResult is 'dimmed' in the global section of my module and just keeps getting redefined each time a new result happens (e.g. a new batter).

My question is should I be doing it this way or should I do without the global variables and just pass the variables from sub to sub?

Excuse my terminology - it usually includes alot of 'things' and 'stuff'.

I can't leave well enough alone. I always tell my self "just make it work, then optimize later", but it rarely happens that way.

Passing Variables Pass's Me OUT!
I have tried and tried to make a variable Item$ Global. I have made Item$ Public in the general section of Module 1 and and made it Public in the General section of Form1. I have made the event Drive1_Change Public. I have tried passing Item$ in the argument list of the sub FindDir(Item$) which is in Module1. What the Devil am I doing wrong besides using VB to re-write this Dos Program?

Can I Pass Variables Into DataReport?
Hello, I am new here and also VB. May I know is there any ways to pass variables from a form to DataReport?

And here is my sample data:

TransactionNo ProductCode Description Cost
1 102 Shampoo $10.00
1 101 Soft Drinks $1.00
1 103 Food $3.00


And I want my Report to be:

TransactionNo: 1
Date: 14/12/2005

ProductCode Description Cost
102 Shampoo $10.00
101 Soft Drinks $1.00
103 Food $3.00


I am using VB6.0, ADODB and MS Access. When I insert Group Heading/Footer in the DataReport, it gives me error while i run [Report Sections do not match Data Source.].
May someone please tell me?? Thx... and sry for bad English.

How Do I Pass Variables Throughout A 'wizard'?
I'm creating a program where there are a series of 'Next >>' and '<< Previous' buttons and I want to pass the variables between the forms. How do I pass the variables, from, say Form1 and Form2? Such as Text1.Text I want to pass, and etc.

Thanks in advance!

Pass Variables In VB.NET To PERL?
Can we pass arguments from VB.NET to a Perl program?
I can start a perl program with process.start method but how can I pass arguments/variables to it?

Thanks for your help!

ADO Pass XML Document As Parameter To Stored Procedure
I have a stored procedure as below

Stored Procedure
-------------------

Code:
Create Procedure sp_employee ( @xml TEXT )
AS
BEGIN
DECLARE @idoc INT
,@emp_id INT
,@emp_add VARCHAR(100)
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlDoc

SELECT @emp_id = ISNULL(emp_id , 0 )
,@emp_add = ISNULL (emp_add , 'N/A')
FROM OPENXML(@idoc, 'ROOT', 2)
WITH ( emp_id INT
,emp_add VARCHAR(100)
)

IF @emp_id <> 0
INSERT INTO employee ( empid , empadd ) VALUES ( @emp_id , @emp_add )

EXEC sp_xml_removedocument @idoc
END


How how i pass the xml document to this stored procedure ?
Basically i know i have to use

i)ADODB.Connection
ii)ADODB.Command
iii)ADODB.Parameter

My parameter is an input parameter so it's adParamInput.
But what about the type of parameter pass in ? any idea ? i know it has adVarchar. Does it has adText ?? Sorry for the out running indent.
Anyone done it before or anyone has any idea ? thanks. i'm newbie over here.

Pass Column To Update Into Stored Procedure?
I have a VB program that tracks who update which fields in a table, and when. These changes get logged into a changeNotes table which shows the field name, the old value, and the new value among other things. There is an interface to list these changes and then approve or deny them.

When a change is denied I need to go back into the table and put the old value back into the field that was update. I am using stored procedures for all of my DB access and I am having trouble with this one.

Is is possible to pass in a column name as a parameter? This is the procedure:


Code:
CREATE PROCEDURE dbo.reverseChange
@recID as int,
@column as varchar(25),
@oldValue as varchar(40),
@newValue as varchar(40)
as
update webrecruit set @column = @oldValue where recID = @recID and @column = @newValue

Is there something special I need to declare for the @column parameter, or is this just not possible to do with a stored procedure?

/<evin

Pass Value From Vb To Store Procedure,whic Called By CR
Hi,All

   I have a problem with vb6 pass value to store procedure,that called by crystal report(7.0)
as below is my code.

Store procedure:

create procedure PRN_VAT_RPT
@rpt_date varchar(10),
@company  varchar(1)
as
select * from Tax_form
where comp_code = @company and tax_date = @rpt_date

VB code :

Private Sub cmdPRINT_Click()
Dim nparams, conn   As Integer
  rptPrint.ReportFileName = App.Path + "
eports
eport1.rpt"
  conn = rptPrint.LogOnServer("p2ssql.dll", "SRVnme", "DBnme", "sa", "")   
  nparams = rptPrint.RetrieveStoredProcParams
  rptPrint.StoredProcParam(0) = ConvDate
  rptPrint.StoredProcParam(1) = Trim(mbCompany)
  rptPrint.Action = 1

End sub

   and the report1.rpt connection with PRN_VAT_RPT procedure (by set location database)
   when run program ,it display error message as :
   Invalid file name.
   
  there is any other way to do the same thing.

Any help is greatly appreciate.
Ndaa
 



How To Pass Cursor Result From Oracle Procedure To Vb
here is my question do plz anyone help me...

i got a procedure in oracle which returns cursor.
now i want to return that cursor result in vb thro the command object. i mean i am using the commandtype as adstoredprocedure. now what type of datatype should i use to get the cursor result to be stored in vb and now how to manipulate that cursor result in vb.

Is There A Way To Pass A Variables Value To A Data Environment?
Hello everyone!!! I would like to ask if there's a way to pass a public variable value to a data environment so the I could pass it in the sql query? Thank you very much in advance.

When And How To Pass Variables To A Form (Newby)
Hi Im into my second day of VB im writting GUI's that interact with CATIA a cad program I know how to write Macros for CATIA but now I want to pass variables from CATIA to a form take input from the form check it and pass it back to catia.

I can create a form with input boxs and pass that data to catia.
I can prepopulate the text fields with data

I dont know where and when my sub routeens should be used whats the differance between a public sub / private sub main sub etc

I'm using


VB Code:
Sub CATMain()    UserForm1.Show    End Sub


to call my form how do i pass data with this to the form?

I really want to go to catia extract the two parameters pass them to the form to show the user what the current value is allow them to change it
error check and then pass the data back to catia.

Here is my code so far MODULE


VB Code:
Sub CATMain()    UserForm1.Show    End Sub   Public Sub CreatePads(length1fromform, length2fromform As Double)               'Dim's The Part Documents And Sets As Current Dim partDocument1 As DocumentDim part1 As Part Set partDocument1 = CATIA.ActiveDocumentSet part1 = partDocument1.Part  'Dim's All Parameters Dim parameters1 As ParametersDim length1 As ParameterDim length2 As Parameter   Dim relations1 As RelationsDim designTable1 As DesignTable  'Sets the parameters from GUI  Set parameters1 = part1.Parameters Set length1 = parameters1.Item("MARCS")Set length2 = parameters1.Item("BOBS") length1.Value = length1fromformlength2.Value = length2fromform  part1.Update End Sub



FORM



VB Code:
Private Sub UserForm_Initialize()     TextBox1.Text = 300    TextBox2.Text = 200    End Sub Private Sub CommandButton1_Click()     Dim length1fromform, length2fromform As Double         length1fromform = CDbl(Me.TextBox1.Text)    length2fromform = CDbl(Me.TextBox2.Text)     Call CreatePads(length1fromform, length2fromform)       Unload Me    End Sub


NEWBY NEEDING SOME GUIDENCE

Madaxe

Can You Pass Values/variables Between Forms??
Thats it... thats my question

How Can I Pass Two Variables To A Sub In Visual Basic?
here is the line of code i'm having problems with:

Connector(24 * 60 * 60, "/")

the compiler tels me that i need to write it equal to smth what is that?

here is how tgis sub was declared:

Public Sub Connector(Coefficient As Long, Character As String)

Pass Variables From Asp To VBScript Run On Server
I am trying to create a web based Windows NT/2000 User Manager. I have already have all the code for the web side and I have VBScripts that will create users, passwords etc. I will have to run these scripts on my server because obviously you can not add users from a VBScript from a browser. Can Someone tell me how to pass variables from a webpage to a VBScript that will run on my server. I am going to use this little sniplet to execute the vbscripts.

<%
Set server_shell = Server.CreateObject("wscript.shell")
server_shell.Run "%comspec% /c FILE_TO_EXECUTE"
%>

Any help would be much appreciated.

Thanks,

Will

Pass Values Of String Variables To A Sub
When I pass arguments to a sub, the sub takes the arguments literally and uses the string variable parameter as the input.
What I'm actually trying to pass is the value of the string variable.
Here's some of the code:

Private Sub txtParts_LostFocus()
Dim intAnswer As Integer
Dim dbs As Database
Dim rst As DAO.Recordset
Dim strPartName As String
Call something_lostfocus(strPartName, "tblpartsinfo", "llngzMaintEntryNoLink", "chrPartName", Me.txtEntryNo, "txtParts")

which then goes to the something_lostfocus sub code here:

On Error GoTo error_handler:
Dim intAnswer As Integer
Dim dbs As Database
Dim rst As DAO.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(strTable, dbOpenTable)
With rst
    .Index = strIndexNo
    .Seek "=", varSeekVal
    strField = ![strTableFieldName]
    
    
    
    
    Debug.Print "Me." & strMeField
    'Me.txtParts

    
    If ("Me." & strMeField) <> strField Then
    intAnswer = MsgBox("Update existing data with this information?", vbQuestion + vbYesNo + vbDefaultButton2, "Motorhome Maintenance Records")
        If intAnswer = vbYes Then
            rst.Edit
            strTableFieldName = "Me." & strMeField
            .Update
        End If
    End If
End With
exit_procedure:

... and so on

the code in the sub has some errors in it because I have been troubleshooting but basically the problem will be for example:
this step: strField = ![strTableFieldName]
will result in strfield equalling !chrPartName

and NOT the value of the field !chrPartName in the associated table.  That's just the first of several examples where it doesn't work.

thanks for taking a look.

Can't Pass Variables To Module1.bas Or Back
I have tried and tried to make a variable Item$ Global. I have made Item$ Public in the general section of Module 1 and and made it Public in the General section of Form1. I have made the event Drive1_Change Public. I have tried passing Item$ in the argument list of the sub FindDir(Item$) which is in Module1. What the Devil am I doing wrong besides using VB to re-write this Dos Program?

 

How To Pass Data Of A Web Page Into Vb Variables
Hi dears,

How to pass data typed in a web site into variables in a VB Project uses Microsoft Internet Explorer Control to browse.
For an expample consider the email sign up page of Yahoo www.mail.yahoo.com opened in a form of VB Project using Microsoft Internet Explorer Control. Now we typed the email ID and password and click Sign In button. This time I want to pass the typed email ID and password into variables in my VB Project.
This is an example only. Really my project opens a e-commerce web site with many fields of cusotmer detail. And I want to pass these data into variables when I click the proceed button.
Please Help me
Klari

Klari

What Is The Smart Way To Pass Variables Between Forms?
Hi all,

I am writing an application in VBA within Access 97. (the customer insisted.... and he pays the bills..... What can I say?)

I have a large number of forms in this application and I need to pass variables between them.

Up till now I have been setting global variables, and passing them that way, this works fine but I now have hundreds of global variables.

Yes, I can use the OpenArgs setting and that is fine if there is only one argument. Where there are 2 or more (most of the time in this instance) it is useless.

Is there a way of saying something like...

DoCmd.OpenForm "frmMyForm (AMessage as string, AValue as integer... etc)" ' or perhaps some other smart way of doing (what seems to me) a very simple and obvious thing that should be easy.

Many thanks in advance

Phil.


 

 

Build A Search Query To Pass Through Stored Procedure
Me again (hopefully for the last time today).
I just started working with stored procedures today so bear with me.
In my app, I used to build a SQL Query based on selections of the main form. For example:

Code:
If strSQL = "" then
strSQL = "[Field] = '" & txtText.Text & "'"
else
strSQL = strSQL & "[Field] = '" & txtText.Text & "'"
end if

'and so on through all the different fields
This used to work great. Now that I'm working with a stored procedure, I can't seem to figure out how to pass a value to the "WHERE" part to signify ALL ( * ). So if, for example, I have an option group that has an "ALL" button. If the user selects all, it needs to send back to allow everything.

Here's the stored procedure:

Code:
CREATE PROCEDURE sp_Query
@Prov varchar(10),
@HomePlan varchar(10) ,
@Alpha varchar(10),
@Adj varchar(10),
@Group varchar(10),
@DF varchar(10),
@Esc varchar(10),
@Tot varchar(10)
AS
SELECT [PROV], [HP], [Alpha], [GROUP], [DFCode], [EscLevel], [TOTAL]
FROM tblClaims
WHERE PROV = @Prov and
HP = @HomePlan and
Alpha = @Alpha and
[GROUP] = @Group and
DFCode = @DF and
EscLevel = @Esc and
TOTAL = @Tot
GO
So in the code about, let's say that the "PROV" group has an "ALL" option. If the user selects it, @Prov needs to be everything (no static value). The same needs to hold true for the other fields as well.

Perhaps I'm just going about building this all wrong, but for now, it's what I know. I've been searching for a while and can't seem to come up with anything; partially because I have no idea what kind of key words to use. Does anyone have some insight to share?

Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved