.


:




:

































 

 

 

 


. SQL DDE




 

1). Microsoft Access Microsoft Word

 

Microsoft Access.

Sub AccessDDE()

Dim intChan1 As Integer, intChan2 As Integer

Dim strQueryData As String

 

' System .mdb.

' DDE.

intChan1 = DDEInitiate("MSAccess", "System")

.mdb.

DDEExecute intChan1, "[OpenDatabase C:\Access\Samples\.mdb]"

 

.

 

intChan2 = DDEInitiate("MSAccess", ".mdb;" _

& "QUERY ")

strQueryData = DDERequest(intChan2, "All")

DDETerminate intChan2

 

' .

DDEExecute intChan1, "[CloseDatabase]"

DDETerminate intChan1

 

' .

Debug.Print strQueryData

End Sub

 

2). Visual Basic DDE Microsoft Access.

 

Dim intChan1 As Integer, strResults As String

intChan1 = DDEInitiate("MSAccess", "System")

' , System.

strResults = DDERequest(intChan1, "SysItems")

' OpenDatabase, .mdb.

' .mdb.

DDEExecute intChan1, "[OpenDatabase C:\Access\Samples\.mdb]"

 

. (, ) .mdb (C:\Msoffice\Access\Samples \.mdb). ϳ DDE ᒺ .

 

3). Visual Basic (.mdb).

 

' Visual Basic DDE .

' (. 2).

intChan2 = DDEInitiate("MSAccess", "")

' .mdb.

strResponse = DDERequest(intChan2, "FormList")

' (OpenForm) .

DDEExecute intChan2, "[OpenForm ,0,,,1,0]"

intChan1 = DDEInitiate("MSAccess", ";SQL")DDEPoke intChan1, "SQLText", "SELECT *"DDEPoke intChan1, "SQLText", " FROM "DDEPoke intChan1, "SQLText", " WHERE [ ] > 100;"strResponse = DDERequest(intChan1, "NextRow")DDETerminate intChan1


4).

DDE Visual Basic .

 

Sub NorthwindDDE

Dim intChan1 As Integer, intChan2 As Integer, intChan3 As Integer

Dim strResp1 As Variant, strResp2 As Variant, strResp3 As Variant

 

' Visual Basic , .mdb.

' .

intChan1 = DDEInitiate("MSAccess", ";TABLE ")

intChan2 = DDEInitiate("MSAccess", ";QUERY ")

intChan3 = DDEInitiate("MSAccess", ";SQL SELECT * " _

 

& "FROM " _

& "WHERE > 10050;")

 

strResp1 = DDERequest(intChan1, "All")

strResp2 = DDERequest(intChan2, "FieldNames;T")

strResp3 = DDERequest(intChan3, "FieldNames;T")

DDETerminate intChan1

DDETerminate intChan2

DDETerminate intChan3

 

' .

Open "C:\.TXT" For Append As #1

Print #1, strResp1

Print #1, strResp2

Print #1, strResp3

Close #1

End Sub

 

 

1. ?

2. , , ?

3. ?

4. ?

5. , . ?

6. ?

7. ?

8. ( ) ?

9. ()?

10. ?

11. SQL ?

12. ?

13. , 䳿 ?

14. SQL? SQL ?

15. , ?

16. 璺, .

17. FROM SQL .

18. ?

19. FROM .

20. SQL . ?

21. ᒺ ?

22. ᒺ .

23. FROM SQL ᒺ .

24. FROM SQL ᒺ .

25. SQL? .

26. SQL ?

27. AS SQL?

28. SQL GROUP BY HAVING?


˳

1. .., .., .. : : . . . . . .- .: , 2007.-151 .

2. .., .., .. : - : . . . . . .- .: , 2007.-98 .

3. htpp://msi77/narod.ru/Tables_2003.zip

4. htpp://www.sql-ex.ru

5. , . MySQL .: . . .: . . , 2007. 880 .





:


: 2016-07-29; !; : 391 |


:

:

: , , , , .
==> ...

1638 - | 1485 -


© 2015-2024 lektsii.org - -

: 0.013 .