Method
Connects to a database server and opens a database.
Category
Database
Syntax
Sub ConnectServerandOpenDatabase(ByVal
DriverName As String, ByVal ServerName As String, ByVal NetType As
String, ByVal DatabaseName As String, ByVal CacheSize As Long,
ByVal UseCommitCache As Boolean, ByVal NTAuthentication As Boolean,
ByVal UserID As String, ByVal PassWord As String)
NDBCDriverName
The driver to use.
Value: |
Means: |
NDBCS |
Microsoft SQL Server |
NDBCN |
Navision Database Server |
ServerName
The name of the server that you want to connect to.
NetType
The network protocol to use for network communication. The network
protocols you can use depend on the server you are running
on.
SQL Server:
Value: |
Means: |
Default |
Use the default Net Type. |
Named Pipes |
Use Named Pipes. |
TCP/IP Sockets |
Use TCP/IP Sockets. |
Multiprotocol |
Use Multiprotocol. |
Navision Database Server:
Value: |
Means: |
netb |
Use NetBIOS. |
tcps |
Use TCPS |
tcp |
Use TCP/IP. |
DatabaseName
The database to open.
CacheSize
The size of the cache in KB.
UseCommitCache
Whether or not to use CommitCache.
UseNTAuthentication
Whether or not to use NT authentication.
UserID
The login name.
PassWord
The password belonging to the UserID.
Comments
You must use this function with the SQL Server Option for Navision,
and we recommend that you also use it if you are running on
Navision Database Server.
C/FRONT does not support the use of extended characters in directory and database names.
SQL Server
Option
The server must be running when you issue this call. All subsequent
calls to access the database will be passed to the server, which
will perform the operations.
To close the connection to a database server, call DisconnectServer.
To open another database on this server or on another server, run this function again.
Access to the database will be governed by the permissions you have been granted.
Navision Database
Server
The server must be running when you issue this call. All subsequent
calls to access the database will be passed to the server, which
will execute the operations.
This function opens a database with a cache that is equal to the CacheSize you have specified.
A cache is an area of RAM that holds the results of recent disk accesses. CacheSize specifies the amount of memory assigned to the disk cache used by the database manager to access the database file. The size depends on which operating system is in use. As a general rule, the larger the cache, the better the performance. See the Installation and System Management: Navision Database Server manual for details.
There are no restrictions to opening a database, but access to the tables may be governed by a password. See Login.
Call DisconnectServer to close the connection to a database server. To open another database on this server or on another server, run this function again.