RE: [U2] connect to an access database

2004-10-25 Thread Chauhan, Savita
Hi Vance,
I see that this is your second post and noone replied to the earlier
one. So I guess there is no way to directly access a database outside of
UV. You may have to write a connection application (I am not even sure,
how!!)

I guess you know that the reverse is possible though. You can connect to
UV/UD database from MS-Access via ODBC.

Hope there is an easier way to achieve what you are trying to do and
someone replies the same.

Good luck.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, October 25, 2004 8:33 AM
To: [EMAIL PROTECTED]
Subject: [U2] connect to an access database

Hello all,

Is anyone familiar with a way to connect an MVBasic app to an access
database
or datasource ?
I need to be able to read/ write to/from a specifiac datasource. Is
there a
way I can connect from within a UV app to another datasource via ODBC ?
Any
transport will do really.
 I was thinking of writing an outside app to do the data connection to
pass
and retr for the uvapp but if theres a more direct approach from the
MVApp
itself, I'm wide open to suggestions.

Thanks in advance,
Vance
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] connect to an access database

2004-10-25 Thread Gordon Glorfield
Vance,

Unfortunately, Access is not robust enough to be a true SQL data source.
What that means to your question is; no it can't be accessed (no pun
intended) from with an U2/MV basic application.  You can however access MS
SQL Server and other mainstream SQL compliant DB products from within an
U2/MV basic application utilizing the BCI (BASIC SQL Client Interface
Functions).

HTH,
Gordon

Gordon J. Glorfield
Sr. Applications Developer
MAMSI (A UnitedHealth Company)
301-360-8839 



 -Original Message-
 Hello all,
 
 Is anyone familiar with a way to connect an MVBasic app to an 
 access database or datasource ? I need to be able to read/ 
 write to/from a specifiac datasource. Is there a way I can 
 connect from within a UV app to another datasource via ODBC ? 
 Any transport will do really.  I was thinking of writing an 
 outside app to do the data connection to pass and retr for 
 the uvapp but if theres a more direct approach from the MVApp 
 itself, I'm wide open to suggestions.
 
 Thanks in advance,
 Vance


This e-mail, including attachments, may include confidential and/or 
proprietary information, and may be used only by the person or entity to 
which it is addressed. If the reader of this e-mail is not the intended 
recipient or his or her authorized agent, the reader is hereby notified 
that any dissemination, distribution or copying of this e-mail is 
prohibited. If you have received this e-mail in error, please notify the 
sender by replying to this message and delete this e-mail immediately. 
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] connect to an access database

2004-10-25 Thread FFT2001
In a message dated 10/25/2004 6:44:30 AM Pacific Daylight Time, 
[EMAIL PROTECTED] writes:

 Is anyone familiar with a way to connect an MVBasic app to an access 
 database
 or datasource ?
 I need to be able to read/ write to/from a specifiac datasource. Is there a
 way I can connect from within a UV app to another datasource via ODBC ?

Your message starts clear, then gets fuzzy.  At the end you ask for ANY 
datasource.  So what exactly are you trying to accomplish?

YES you can, from within MvBasic, read and write to an outside datasource.  
The devil is in the details of this.

For example, I have an MvBasic program, that connects to WorldShip.  It sends 
data into WorldShip on a box to be shipped, WorldShip then processes the data 
(with possible user additional input), and the data is sent back into the 
MvBasic program.  All of this is interactive, not batch.

I have another MvBasic program, that writes data, launches Access and tells 
it to suck in the data, and write out a response, and then reads the response.

It really all depends on exactly what you're trying to accomplish.
There are many ways to skin a cat, but none in which the cat is very happy.
Will
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: Spam:[U2] connect to an access database

2004-10-25 Thread Mark Eastwood
I use UniVerse's BCI (Basic Calling Interface) to READ data from
Access/MySQL/DB2.  Never tried to WRITE.

Mark.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 25, 2004 9:33 AM
To: [EMAIL PROTECTED]
Subject: Spam:[U2] connect to an access database

Hello all,

Is anyone familiar with a way to connect an MVBasic app to an access
database
or datasource ?
I need to be able to read/ write to/from a specifiac datasource. Is
there a
way I can connect from within a UV app to another datasource via ODBC ?
Any
transport will do really.
 I was thinking of writing an outside app to do the data connection to
pass
and retr for the uvapp but if theres a more direct approach from the
MVApp
itself, I'm wide open to suggestions.
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] connect to an access database

2004-10-25 Thread Stu Glancy
I was very interested to see your code but the attachment didn't make 
it.  Could you paste your code into another email?  Much appreciated.

Stu Glancy
Richard Taylor wrote:
Yes, you can do this, I have an operation program that reads and writes an
Access Database from a UV Basic program.  I am attaching a sample program
that shows the techniques written under Universe.  I had to change the
code to remove any proprietary information, but you should still be able
to follow the logic of reading and writing to an access database.  One
caveat, this was written to work with UV on Windows.  I believe that this
should work on Unix too as long as ODBC has been configured.  You will
also need to setup an odbc data source on the client that points to your
Access database. In this program that is call SOSHIP and is referenced
in the MDB.CONNECT subroutine.  Sorry I don't have an example of that, but
if you have trouble post back an I will dig in some more.
Rich Taylor | Senior Programmer/Analyst| VERTIS
250 W. Pratt Street | Baltimore, MD 21201
P 410.361.8688 | F 410.528.0319 
[EMAIL PROTECTED] | http://www.vertisinc.com

Vertis is the premier provider of targeted advertising, media, and
marketing services that drive consumers to marketers more effectively.
The more they complicate the plumbing
 the easier it is to stop up the drain
- Montgomery Scott NCC-1701
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Monday, October 25, 2004 9:33 AM
To: [EMAIL PROTECTED]
Subject: [U2] connect to an access database
Hello all,
Is anyone familiar with a way to connect an MVBasic app to an access
database
or datasource ?
I need to be able to read/ write to/from a specifiac datasource. Is there
a
way I can connect from within a UV app to another datasource via ODBC ?
Any
transport will do really.
I was thinking of writing an outside app to do the data connection to
pass
and retr for the uvapp but if theres a more direct approach from the MVApp
itself, I'm wide open to suggestions.
Thanks in advance,
Vance
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
[demime 1.01d removed an attachment of type application/octet-stream which had a name 
of ACCESS DATABASE CODE]
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] connect to an access database

2004-10-25 Thread Richard Taylor
Many people have emailed to ask for the attachment since it got filtered.
I am inserting it as text below my signature.

Rich Taylor | Senior Programmer/Analyst| VERTIS
250 W. Pratt Street | Baltimore, MD 21201
P 410.361.8688 | F 410.528.0319 
[EMAIL PROTECTED] | http://www.vertisinc.com

Vertis is the premier provider of targeted advertising, media, and
marketing services that drive consumers to marketers more effectively.

The more they complicate the plumbing
  the easier it is to stop up the drain

- Montgomery Scott NCC-1701

**\/\/\/\/\/\//\/\/\/\/\/\/\/
$INCLUDE UNIVERSE.INCLUDE ODBC.H
*
  PROGRAM = 'SOSHIP.UPDATE'
  ERROR.NO = 0
 
*---
  *Preparing the SQL processes
 
*---

  SQL.OK = TRUE  ; * error flag for sql processes
  SQL.STATUS = ClearDiagnostics()

  * setup the ODBC connection to the SOSHIP.mdb file
  SQL.STATUS = SQLAllocConnect(@HENV,SOSHIP.MDB.CONNECT)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not establish a connection to the Access
workspace: 
 MESSAGE := Failed to allocate a CONNECTION environment
 GOSUB ERROR.PROCESS
 SQL.OK = FALSE
  END
  IF SQL.OK THEN
 GOSUB MDB.CONNECT
  END; * endif sql.ok
(SOSHIP.MDB.CONNECT)

  * Setup the ODBC connection to the LOCAL UV account
  SQL.STATUS = SQLAllocConnect(@HENV,SOSHIP.UV.CONNECT)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not establish a connection to the Universe
Database environment: 
 MESSAGE := Failed to allocate a CONNECTION environment
 GOSUB ERROR.PROCESS
 SQL.OK = FALSE
  END
  IF SQL.OK THEN
 SQL.STATUS = SQLConnect(SOSHIP.UV.CONNECT,localuv,'','')
 IF SQL.STATUS  SQL.SUCCESS THEN
MESSAGE = Could not establish a connection to the Universe
Database environment: 
MESSAGE := Failed to connect to data source
GOSUB ERROR.PROCESS
SQL.OK = FALSE
 END
  END; * endif sql.ok
(SOSHIP.UV.CONNECT)

  * setup customer table transfer sql statement environments
  SQL.STATUS = SQLAllocStmt(SOSHIP.UV.CONNECT,CUSTOMER.SEL.STMT)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not access the CUSTOMER file in Universe: 
 MESSAGE := Failed to allocate a STATEMENT environment (select)
 GOSUB ERROR.PROCESS
 SQL.OK = FALSE
  END

  SQL.STATUS = SQLAllocStmt(SOSHIP.MDB.CONNECT,CUSTOMER.INS.STMT)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not access the CUSTOMER file in Universe: 
 MESSAGE := Failed to allocate a STATEMENT environment (insert)
 GOSUB ERROR.PROCESS
 SQL.OK = FALSE
  END

  * SQL statement objects to access SOSHIP.MDB parts Allocations table
  SQL.STATUS = SQLAllocStmt(SOSHIP.MDB.CONNECT,SOSHIP.PARTS)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not access the SOSHIP parts allocations table in
SOSHIP.mdb: 
 MESSAGE := Failed to allocate a STATEMENT environment
 GOSUB ERROR.PROCESS
  END

  * SQL statement objects to access SOSHIP.MDB Order Allocations table
  SQL.STATUS = SQLAllocStmt(SOSHIP.MDB.CONNECT,SOSHIP.ORDERS)
  IF SQL.STATUS  SQL.SUCCESS THEN
 MESSAGE = Could not access the SOSHIP Orders Allocations table
in SOSHIP.mdb: 
 MESSAGE := Failed to allocate a STATEMENT environment
 GOSUB ERROR.PROCESS
  END

  IF NOT(SQL.OK) THEN
 CLOSE SOSHIPF
 STOP
  END; * endif not(sql.ok) ...
  *---
  *  End of SQL Preparation
  *---

  LOOP
 SQL.STATUS = ClearDiagnostics()
 SQL.OK = TRUE

 GOSUB RESET.SQL.STATEMENTS
 GOSUB PREPARE.SQL.INSERT.COMMANDS
 IF NOT(SQL.OK) THEN EXIT

 SQL.STATUS = ClearDiagnostics()

 ' code removed
  UNTIL RET.VALUE1 = CANCEL DO
 SOSHIP.ID = PART.NO:*:LOCATION

 * get the inventory balance and part description
 INV = RAISE(TRANS('INV',PART.NO,-1,'X'))
 LOCATE(LOCATION,INV,2;LOC.VMC) THEN
INV.BAL = OCONV(INV3,LOC.VMC,'MR4')
 END ELSE
INV.BAL = 0
 END ; * endlocat(location,inv 
 PART.DESC = TRANS('PARTS',PART.NO,1,'X')

 * calculate header totals
 ALLOC = OCONV(SUM(SOSHIP14),'MR4')
 ON.ORDER = OCONV(SUM(SOSHIP4), 'MR4')
 BACKORDER = ON.ORDER - ALLOC
 NUM.ORDER = 0
 NUM.CUST = 0

 * select the customer data  add to soship.mdb database