Passing parameter to DataEnvironment

Visual Basic

    Next

  • 1. send mail
    Hi, I'm looking for a way to send an email with attachement from a windows (not web) vb6 application, I prefer that this will be done in backend, with a way to give all info as parameters (to, subject, message and attached file) any idea please?
  • 2. MSFlexGrid - Max number of Visible Rows ?
    Can anyone confirm what the Maximum numbers of visible Rows is for MsFlexGrid control? I have just converted an old project which used Grid32 as a grid which was limited to 2000 rows. I was wondering if the limit has been removed with MsFlexGrid. I can set Rows above 2000 and it does not complain. I was wondering if someone can confirm that the control is ok above 2000 and, if possible, what the limit is? Neil..
  • 3. How to replicate keystrokes on internet explorer
    Ive designed my own web-browser and I'm trying to get it to download various files past a login screen. I'd like to know how to replicate certain keystrokes within the browser (Tab, space, enter and A-Z keystrokes) so it automatically does this - currently Im downloading several 100 files a day and its driving me nuts. Must be done via HTTP, the template stays the same but file names change. Any help appreciated. Thanks. Mike
  • 4. VB Webbrowser and IE history
    Hi there, How to prevent IE EXPLORER to not record URL opened throught my new Web Browser developped using VB .NET, on the IE History or address bar. Thanks in advance,
  • 5. Imagelist icon "Invalid Picture" problem.
    Hey all, I'm trying to give an XP facelift to a VB6 application. I'm using a listview control in report format, and I want to add some high color icons to spruce up the look of it. However, when I try to load the images into the control at design time, it keep throwing an "invalid picture" error. Could anyone suggest a way to make the imagelist friendly to 256 color icons? Thanks, Whitey

Passing parameter to DataEnvironment

Postby Marty » Wed, 26 Jan 2005 07:04:24 GMT

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

Re: Passing parameter to DataEnvironment

Postby Veign » Wed, 26 Jan 2005 09:48:26 GMT

Not sure on the answer but I would highly advice that you get away from
using the Data Environment.

Eliminating it will give you a better knowledge of ADO and database
connectivity plus eliminate the short comings of the Data Environment (which
this may be one of them), and eliminate a big dependency that must be
installed on any users computers....

-- 
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
 http://www.**--****.com/ 







Re: Passing parameter to DataEnvironment

Postby Marty » Wed, 26 Jan 2005 22:58:58 GMT

Hi Veign,

You are totally right.  I am actually doing maintenance on a software 
that used a lot of dataenvironment.  It would be a nightmare to 
eliminate all those dataenvironment it in this step, but it is in the 
planning to move to a better DB handler.

Using dataenvironment is like being trapped in a box, hard to maintain 
and poor in flexibility.

Thanks for your reply :)

Marty






Re: Passing parameter to DataEnvironment

Postby Ralph » Thu, 27 Jan 2005 00:13:04 GMT






(which

IMHO: The Data Environment is a very useful tool within the 'environment' it
is meant to be used. (Pun intended)
There is an implied 'box' since the DE is in a sense a subset of the
complete Data Library, however, that subset represents a excellent core of
functionality and methodology to using ADO productively. I have found that
most developers abandon the object model too soon and drift into procedural
designs. Working with ADO via the DE for awhile, helps to avoid this. And
ADO used separately outside the DE, is best when it follows the DE model.

As the main strength of the DE is the precisely the increased ease of
maintenance, I would suggest that Marty might want to take a closer look at
what the original programmer was attempting to do before turning his back on
it and re-inventing some wheel.

As for the original question. No it would not be easy to create a separate
parameter for a table. As the DE is an integrated enviroment, when building
a command it likes to see the database objects it is dealing with upfront.
However, I believe that unless you have a large number of tables with
identical fieldnames, I can not see where such a query would be useful in
terms of defining a business object.

But then I have no clue about the OP's problem domain. It is possible to
write 'bad' code using any tool or not using any tool. <g>

-ralph



Re: Passing parameter to DataEnvironment

Postby Marty » Thu, 27 Jan 2005 05:13:00 GMT

Thanks for your comment Ralph,

I understand now that it can be a worderful tool when used in a 
professional manner from design to implementation.

I had to do maintenance on another software made by another programmer 
who used the dataenvironment (not in professional way), and I saw things 
that were nightmare to debug.  But I never saw a professional way of 
using the dataenvironment, maybe that would have give me other great 
idea or at least, a better view of it.

Have a nice day.

Marty











Re: Passing parameter to DataEnvironment

Postby Veign » Thu, 27 Jan 2005 05:18:24 GMT

ataEnvironment is *not* a professional tool - IMHO. Limiting and causes
your application to carry extra baggage. It may be easy to use and inviting
to use by its simplicity but its not the best path for database aware
applications.

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
"Marty" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
'environment' it
of
that
procedural
And
model.
at
back on
separate
building
upfront.
in



Re: Passing parameter to DataEnvironment

Postby Ralph » Thu, 27 Jan 2005 23:52:24 GMT





inviting

Well at least this time you used the "IMHO" modifier. Though I doubt the
'H'.

<g>
-ralph




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.Dataenvironment VB parameters troubles

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

4.Passing a Dataenvironment.rsMyRecordset to a sub routine.

Hi,

What is a type of a Dataenvironment.rsMyRecordset if I want to pass it 
to a sub routine?

'Can it be a recordset? I tried different type, but didn't got the right 
one...

private sub mySub(rsDEObj as ADODB.RecordSet)
'...
end sub

Thanks you

Marty



Return to Visual Basic

 

Who is online

Users browsing this forum: No registered users and 59 guest