Dataenvironment VB parameters troubles

Visual Basic

    Next

  • 1. need help with Combobox sorting
    I'm having troubles with this, I load this file into a combobox in the form load () for L= 0 to filecount cbName.AddItem Name(L).partnum next in the cbName_Click() Text1(0).Text = Name(cbName.ListIndex).partmat Text1(1).Text = Name(cbName.ListIndex).partfinish Text1(2).Text = Name(cbName.ListIndex).partnumprev Text1(3).Text = Name(cbName.ListIndex).partnumnext ......... that keeps everything properly synchronized so when I select something from the combobox the correct related data is shown in the textboxes. My problem is the Name file is not sorted and if I set cbName to sorted eveything is out of order,how can I sort and keep everything properly related Thanks for any pointers SteveC
  • 2. How to make root object global to other objects?
    Hi, I have the following object model Application[Property:Version] Users[Propety:Item] User[Propety: Name] from a user property,is it possible to write something like this Property Get Name() as string Name=mstrName + Version <------------------ end property instead of: Property Get Name() as string Name=mstrName + Application.Version <------------------ end property Thanks in advance
  • 3. Font Change
    Hi....I know this has got to be simple but here it is. I need to change the font of text in a textbox or rich textbox. I have the CommonDialog component and I have added code to change the text to bold. The problem is it changes ALL the text to bold. I would like it to only change the text I am typing to bold(as in Word and others.) Does somebody have a code example of how to do this? Thanks a ton. JD XXXX@XXXXX.COM
  • 4. writing to text file
    Hoping someone could help. I need to write to a text file from a VB6 app. More specifically I am writing to a text file using the Open "C:\Rick's file" For Output As #1 and Write #1 "!Ricks Text" "Ricks Text" app's variable another variable I need it to write to notepad without the quotation marks showing and with a tab space between each text entry. I also need to know how to write to a new line. I appreciate any and all help. Thanks newbieRick

Dataenvironment VB parameters troubles

Postby fconti10 » Tue, 05 Aug 2003 18:19:36 GMT

Hi to all, perhaps this is due only to my ignorance in vb
dataenvironment but:

a) I've created the following SQL statement into SQL server connection
(Ole Db provider for SQL server, or OLE DB Provider for ODBC (SQL
Server))
with one parameter =? i.e the job_id number inputed by me:

SELECT job_id, job_desc FROM jobs WHERE (job_id =?) 
UNION ALL 
SELECT job_id, job_desc FROM jobs WHERE ( job_id=? OR job_id=?) 

(I know this is a stupid query but it explains the fact that the
parameter is always the same, so I'm expecting to declare it only
once)

b) After that I see into parameters tab three parameters. 
So when I call the command (named command1) I'm requested for three
parameters.

I tried to do the same thing into a MS Access connection via an
addition of the statement PARAMETERS:

PARAMETERS jb int; 
SELECT job_id, job_desc FROM jobs WHERE (job_id =jb) UNION ALL SELECT
job_id, job_desc FROM jobs WHERE ( job_id=jb OR job_id=jb)

In this case it work fine and I'm happy, because I can see only one
parameter into parameters tab,
and I'm prompted for one and only one into vb code. 

Is there the same way to proceed with SQL Server too? (I know that I
can avoid this with stored procedures or with the dirty method to
provide always 3 parameters instead of one,but I'm doing the porting
of a program not written by me and I'd like
to adhere to original MS Access driven code) 
Thanks in advance to all! 
Fabs

Similar Threads:

1.Passing parameter to DataEnvironment

Hi,

Is it possible to pass parameter to a dataenvironment?

I want it to execute a SQL query, but the query is builded using the SQL 
builder in the dataenvironment.  I want that rsMyRecordset being made on 
different table that I specify.

DataEnvironment1.rsMyRecordset.RecordCount

Something like a "SELECT * FROM " & strMyTable executed in the 
DataEnvironment1.rsMyRecordset

Can this be done?

Thanks you very much

Marty

2.Parameters in DataEnvironment

Hi, 
I am using VB6 with SQL2000 under SBS2003.

Why is tab2 (Parameters) within the DataEnvironment disabled ?
I want to add a new command, which is a SQL-statement with a
parameter (which is a public variable from the Form), like this: 
SELECT * from Table WHERE ID = m_XYZ
So the value of m_XYZ should be passed to the DataEnvironment(SQL)command.
I think, I have to set this parameter (m_XYZ) in the DataEnvironment, by 
using this tab2 (Parameters), but I cannot access the fields (adding the 
parameter m_XYZ for instance) of this tab.
I have tried the following statements, but nothing seems to work:
SELECT * from Table WHERE (ID = [m_XYZ])
SELECT * from Table WHERE ID = [m_XYZ]

In my opinion I need to use a certain syntaxis in above statement, on which 
the
DataEnvironment "regcognizes" this variable and put it in the 
(tab2)-parameterlist.

Or am I totally wrong ? Any help is appreciated,

regards, Ger.

3.Passing parameter to DataEnvironment

Hi,

Is it possible to pass parameter to a dataenvironment?

I want it to execute a SQL query, but the query is builded using the SQL 
builder in the dataenvironment.  I want that rsMyRecordset being made on 
different table that I specify.

DataEnvironment1.rsMyRecordset.RecordCount

Something like a "SELECT * FROM " & strMyTable executed in the 
DataEnvironment1.rsMyRecordset

Can this be done?

Thanks you very much

Marty

4.trouble w/ creating a VBA function that uses an enum in it's parameters

Greetings,

I have an enum that I use as a variable in a function.  If I call on
the function from w/in the VBA IDE, the enum values are displayed, but
not when I call on the function from w/in Excel.

I have tried all sorts of things, but I am at my wit's end.  Here is
the code...

Public Enum To_Unit
    eMinute = 1
    eHour = 2
    eDay = 3
    eWeek = 4
    eMonth = 5
End Enum

Public Function ChangeUnit(Target As Range, ToUnit As To_Unit) As Long


Thanks in advance, 
Jacob

5.Trouble Passing Parameters To Report

Hi

I have VB.Net project which has a Crystal Report to display some data.
The data is to come from a stored procedure I have in an SQL 2000
database, this stored procedure takes three parameters, 2 of DateTime
type and 1 of String type. I have played around with the parameters
collection but cannot get it to work properly. I do not want the
dialog box to prompt the user for the field values I want to pass
these from my code. I am confused as to how to pass three separate
parameters. I have my report set up and the parameters appear in the
field tree as they should. Does anyone know of any good sources of
information on passing parameters in Crystal Reports. The
documentation has me confused.

Many Thanks
Kim

6. Trouble with Crystal parameter - "Specified cast is not valid"

7. CR9 Trouble prompting SOME rpt parameters

8. Trouble with binary stored procedure parameter



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 9 guest