Avatar billede whistler_whistler Nybegynder
19. april 2002 - 23:02 Der er 3 kommentarer og
1 løsning

Hvad betyder denne kode?

Jeg er ved at skrive en eksames-opgave, blandt andet om ASP. Jeg har flg. kode som jeg skal forklare, det jeg ikke kan finde ud af er konstanterne  2, 3, &H0001 på den sidste linie, nogle forslag??
strconn = "driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath ("/db/hej.mdb")
set objRS = server.createObject("ADODB.RECORDSET")
objRS.open "SELECT * FROM besked", strconn, 2, 3, &H0001
Avatar billede eagleeye Praktikant
19. april 2002 - 23:05 #1
her er hvad tallere er:

'-----------------------------------------------------
' ADO Cursor Types
'------------------------------------------------------
Const adOpenUnspecified = -1
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
'------------------------------------------------------
' ADO Lock Types
'------------------------------------------------------
Const adLockUnspecified = -1
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4


objRS.open SQL, connection, Cursor Types, Lock Type
Avatar billede eagleeye Praktikant
19. april 2002 - 23:14 #2
Her er de sidste konstanter:

'---- CommandTypeEnum Values ----
Const adCmdUnknown = 0
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004


objRS.open SQL, connection, Cursor Types, Lock Type, Commandtype
Avatar billede slebcsysdk Nybegynder
19. april 2002 - 23:19 #3
Et sammendrag fra msdn:

Syntax:
recordset.Open Source, ActiveConnection, CursorType, LockType, Options

Cursortype:
0: adOpenForwardOnly (Default) Opens a forward-only–type cursor.
1: adOpenKeyset Opens a keyset-type cursor.
2: adOpenDynamic Opens a dynamic-type cursor.
3: adOpenStatic Opens a static-type cursor.

LockType:
1: adLockReadOnly (Default) Read-only—you cannot alter the data.
2: adLockPessimistic Pessimistic locking, record by record—the provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately upon editing.
3: adLockOptimistic Optimistic locking, record by record—the provider uses optimistic locking, locking records only when you call the Update method.
4:adLockBatchOptimistic Optimistic batch updates—required for batch update mode as opposed to immediate update mode.

Option:
1: adCmdText Indicates that the provider should evaluate Source as a textual definition of a command.
2: adCmdTable Indicates that ADO should generate an SQL query to return all rows from the table named in Source.
512: adCmdTableDirect Indicates that the provider should return all rows from the table named in Source. 
4: adCmdStoredProc Indicates that the provider should evaluate Source as a stored procedure.
8: adCmdUnknown Indicates that the type of command in the Source argument is not known.
256: adCmdFile Indicates that the persisted (saved) Recordset should be restored from the file named in Source. 
16: adAsyncExecute Indicates that the Source should be executed asynchronously.
32: adAsyncFetch Indicates that after the initial quantity specified in the Initial Fetch Size property is fetched, any remaining rows should be fetched asynchronously. If a row is required that has not been fetched, the main thread is blocked until the requested row becomes available. 
64: adAsyncFetchNonBlocking Indicates that the main thread never blocks while fetching. If the requested row has not been fetched, the current row automatically moves to the end of the file.
Avatar billede whistler_whistler Nybegynder
19. april 2002 - 23:23 #4
tak for hjælpen
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester