Direct ORA / Direct SQL
LЃCgEc[ \
ؑbr/>̃R|[lg̖{̂́ADirectSQL.DLLłAVisual BasicȂǂ͎QƐݒĎgBg͂ăJ^łBVisual BasicgƂ̗B
TṽfBNg: \DirectSQL\Samples\Pubs
- @
- DBLibraryIuWFNg̍쐬 Dim oDBL As New DBLibrary ̂悤ɂāADBLibraryIuWFNg쐬B炷ׂĂn܂BȌ́AoDBLx[XɂׂĂ̍ƂŝŁAVisual Basicł̃IuWFNg̃ANZX邽߂ɁAWith`End WithubN̒ŋLq邱ƂɂB
With oDBL R[hc End With
- T[o[Ƃ̐ڑ Initialize\bhŏƁAT[o[Af[^x[XA|U[ApX[hw肵AOpen\bhŐڑB
' ڑ .Initialize .Server = "sqlsvr" .Database = "pubs" .User = "sa" .Password = "passwprd" .Open
- SQL̔s ^ϐsSQLSQLݒ肵ACompile\bhSQLRpCAExecute\bhŎsBSQĹATransact SQLŋLqꂽGȂ̂łĂŎs"\łBASELECTłȂANVNG[XgAhvV[W̎sȂǂ"\łB
' SQL̔s .Compile sSql .Execute
- Resultset̎擾 Transact SQLsƁASQL Server1ȏResultsetԂBƂAXg(DirectSQL\Samples\Pubs\rept.sql)̂悤ȕGSQLSQL ServertISQL/w[eBeBgĎsƁA}̂悤ɕ̏邱ƂnYB́ux܂v1ZbgЂƂResultsetȂ̂łB
DirectSQLł́AGetNextResultvpeBQƂ邲ƂɁAResultset邱Ƃł悤ɂȂĂBselecťʂȂǂFetcĥ́Â悤Ƀ[vōsƂɂȂB
Do While .GetNextResult 'Resultset͓ǂݔ If .Columns.Count <> 0 Then FetchȂǂ̏c End If Debug.Print "RowCount:"; .RowCount Loop
ISQL/wł悤ɁAuSELECT @pub_id = "%%%%%%%%"v̂悤ȕɑĂResultsetԂĂ킯A͌ʃZbgƂĎ擾Kv͂ȂBŁAColumnus.CountvpeB0̂Ƃɂ́AFetchȂǂ͂ȂŁAGetNextResults悢B
FetchɂĂResultseťʂ荞ŁARowCountvpeBɂ͏ꂽsԂB
ȂAResultsetKvȂƂAKvResultsetoɂ́ACancel\bhgĂ̂ƂResultsetj邱ƂłB