Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

Connectivity of Microstation to Access Database

$
0
0
Hello
About 10 years ago I developed code embedded in Microsoft Access Database using the instruction shown below which effectively made Microstation a subset of Microsoft Access Database. I used the code to fire commands from Microsoft Access Database to Microstation (at that time it was Microstation V7). It gave me brilliant results.
Since Microstation V8, the command    [Set msApp = CreateObject("MicroStation.Application")] does not seem to work. Is there a way by which I can make make it work
Thanks in advance
Regards
John Chugh

----------------------------------------------------------------------------------------------------------------------------------------------------------------
"OLE Automation Servers must supply an "Application" object. The Application object provides access to top-level functionality of the application--that is, functionality that is not related to a specific object within the application. Such functionality in MicroStation BASIC is provided through "standalone" extension functions. For example, an extension function called MbeGetConfigVar returns the expansion of a MicroStation configuration variable. In MicroStation's OLE Automation implementation, standalone extension functions are not allowed, so all such functions and statements are instead methods of the Application object. Thus, whereas in MicroStation BASIC, the syntax for retrieving a configuration variable expansion is:
     Sub Main
   Dim expConfigVar As String
   ...
   expConfigVar = MbeGetConfigVar("MS_DEF")
   ...
     End Sub
 
   In Visual Basic the syntax is:
 
   ' Note: The Application object declaration is usually in
   ` the public declarations section
   ' so it can be used anywhere in the program
   Dim msApp As Object
 
     Sub Main
   Dim expConfigVar As String
   Set msApp = CreateObject("MicroStation.Application")
   ...
   expConfigVar = msApp.MbeGetConfigVar("MS_DEF")
   ...
     End Sub
The line creating the msApp object must be executed only once in the program. To convert a program from MicroStation BASIC to Visual Basic, find all the standalone extension functions and make them methods of the MicroStation Application Object. "
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------

Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>