Gandalf_der_Graue Geschrieben 24. April 2003 Teilen Geschrieben 24. April 2003 Hi ihrs, weiß einer von euch, wie ich in Centura eine Datenbank über OLE DB (mit CreateSession) ansteuern kann ? Gruß GdG Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen Mehr Optionen zum Teilen...
Darth_Zeus Geschrieben 24. April 2003 Teilen Geschrieben 24. April 2003 Was genau verstehst du denn daran nicht? SqlCreateSession This function creates a new session. This function takes as its input argument a string which specifies all the properties for this session. . This call returns a valid session handle if the call was successful. All statements created using a single session belong to the same transaction. Thus, a commit call on a given session handle commits SQL operations on all the statements belonging to that session. Similarly, a rollback on a session rolls back all SQL operations on all statements belonging to that session. Instead of taking a SqlHandle as its input (as compared to the old SqlConnect function ), this function takes the Session Handle. About session properties: OLE DB specifications allow a program to set specific session properties at the time of establishing a session. Using SAL, you do not have to make a separate function call to set these prooperties. CTD internally sets all the properties to the values specified in this call. Session Properties also remove any dependency on SQL.INI file; the call to create the session itself provides all the information necessary to identify the OLE DB provider to be targeted for this session. For example, a CTD application wishing to connect to SQLBase using the Centura OLE DB Data Provider specifies, at the minimum, the following session property: Set strSessionProp = "Provider=SQLBASEOLEDB;" Parameters hSession Session Handle. The session handle created as a result of this call. strSessionProperties String. The string that specifies the session properties for this session. It includes the database name, user ID and password values from SAL global variables SqlDatabase, SqlUser and SqlPassword respectively. Return Value bOk is TRUE if a new session was created successfully. If the call failed, it returns FALSE. Example If dfSessionProp != '' Set strSessionProp = strSessionProp || dfSessionProp Set SqlDatabase = dfDatasource Set SqlUser = dfUser Set SqlPassword = dfPassword Set bOk = SqlCreateSession (hSession, strSessionProp) If bOk Call SalMessageBox( 'Create session done', 'Good!', MB_Ok ) Call SalEnableWindow( pbFreeSession) Call SalEnableWindow( pbFreeStatement) . Call SalEnableWindow( pbCreateStatement) Call SalEnableWindow( pbExecuteSQL) Else Call SalMessageBox( 'Create session failed', 'error!', MB_Ok ) Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen Mehr Optionen zum Teilen...
Empfohlene Beiträge
Dein Kommentar
Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.