?? DDEREQUEST ?????? ?????

?????? ????????? ?????? ?????????
???? ???????: 151278 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
????? ???? | ?? ????

?? ??? ??????

???????

??? ??? ?????? DDERequest ??????? ????? ??? ????????? ???????? (SQL) (QueryDefinition ????) ?? "????? SQL ????? ????? ???????? ???????" (ODBC) (ODBCSQLStatement ????) ?? Microsoft Query ?? ??? ???????? ???????.

?????? ????????? ???? ???? ?? ???? ??? ????? ???????:
   DDERequest(<channel>, "QueryDefinition/n")
				
   DDERequest(<channel>, "ODBCSQLStatement/n")
				
???? <channel>????? ???????? ?????? (DDE) ??? ????? ?????? Microsoft Query.

???? ??????

???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ?????. ??? ????? ???? ?? ????? ??? ???????? ??????? ?????? ???????? ?? ???????? ???? ????. ????? ??? ??????? ???? ?????? ?? ??? ??????? ???? ??? ????? ?? ??????? ???? ??? ????????? ?????? ?????? ?????????. ???? ??????? ????? ??? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ??????? ?????. ????? ???? ???????? ???????? ????? ?????? ??????? ?? ??? ???????:
   DDERequest(<channel>, "QueryDefinition/n")
				
   DDERequest(<channel>, "ODBCSQLStatement/n")
				
??? <channel>DDE ??? ????? ?????? ???????? ?? Microsoft Query

???? ????? ?????? ????? ??? ??????? ???? ????? SQL ?? ???? ?????. ????? ??????? ??????? Visual Basic for Applications ????? ????????? ???????? ???? ????? SQL ??? ???? ??? ???????? ????? ?????? ????? ??? ???????.

????? ????????? ???????? Visual Basic

???? ??? ????? ??? ??????? ?????? ????? Microsoft Query 2.0 ? ??? ????? ????? ???? ?????? ?????? ???????? ??? Microsoft Excel. ??? ??? ???? ??? ????? ????? ??? ??????? ?????? ?????? "Getting Started ?? Office ?????? ??? ???? ??????? Microsoft Windows 95" "?" ??????? Microsoft Query.

???? ???????? ???????? ??????? ?? ???? ???? ?????:
   Sub TestArrayQueryDefinition()

   '   Activate a worksheet.
   Worksheets(1).Activate
   '   Initiate a Channel to MSQuery.
   Chan = DDEInitiate("MSQUERY", "System")

   '   Give the user control in Microsoft Query so they can select data
   '   from a database and return to Excel.
   DDEExecute Chan, "[UserControl('&Return to Excel',3,true)]"
   '   At this point the code opens Microsoft Query and waits
   '   for the user to select a Data Source, Data Table(s), and data to
   '   return to Microsoft Excel.

   '   To request the Query Definition be parsed into of 50 character
   '   sections...
   QryDefArray = DDERequest(Chan, "QueryDefinition/50")
   '   To format the parsed Query Definition data...
   ArrayLen = UBound(QryDefArray, 1)
   Range("A1").Value = "Query Definition (renamed Column Names) in " _
      & ArrayLen & " parts:"
   '   If the Array length is one then a one dimension array is returned,
   '   if the Array length is greater than one, a two dimension array is
   '   returned.
   If ArrayLen = 1 Then
   '   Place the single line of data on the worksheet and remove wrap text.
      Range("A2") = QryDefArray(1): Range("A2").WrapText = False
   Else
   '   Place the parsed lines of data on the worksheet and remove wrap
   '   text.
      For i = 1 To ArrayLen
         Range("A" & i) = QryDefArray(i, 1)
         Range("A" & i).WrapText = False 'To undo wrap text
      Next i
   End If

   End Sub
				

???????

???? ???????: 151278 - ????? ??? ??????: 03/???? ??????/1435 - ??????: 2.3
????? ???
  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 95 Standard Edition
  • Microsoft Excel 5.0 Standard Edition
  • Microsoft Query 2000
????? ??????: 
kbnosurvey kbarchive kbmt kbprogramming KB151278 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????151278

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com