ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] rs.Open strsql, cn°ÝÃD½Ð±Ð

[µo°Ý] rs.Open strsql, cn°ÝÃD½Ð±Ð

DEAR  ALL ¤j¤j
1.°õ¦æ¹Ï¤@µ{¦¡¥X²{
  °õ¦æ¶¥¬q¿ù»~2147217900(80040E14)
  FROM KEYWORD NOT FOUND WHRER EXPECTED
1.1 BUG¥X°±©ó  rs.Open strsql, cn
2.½Ð°Ý¦U¦ì¤j¤j°ÝÃDÂI©ó¦ó³B??·Ð¤£§[½ç±Ð  THANKS*10000

¹Ï¤@
Sub BY_PN()
    Range("B2:IV65536").ClearContents
    Dim cn As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim strsql As String
    cn.Open "Provider=MSDAORA.1;Password=BATCH;User ID=URCE01B;Data Source=QSRS05A"
    A = 2
    Do Until Range("A" & A) = ""
        PN = Range("A" & A)
        If IsNumeric(Mid(PN, 2, 1)) Then pntyp = "PN_S" Else pntyp = "PN"
        strsql = "SELECT VWDD5013_2.MTNO,VWDD5013_2.THK,VWDD5013_2.CUTHK,VWDD5013_3.MTKND,VWDD5013_3.MTNO,VWDD5013_3.MTTHK Chr(13) & "" & Chr(10)" _
               & "FROM VWDD5013_2,VWDD5013_3" & Chr(13) & "" & Chr(10) _
               & "Where VWDD5013_2.PN=VWDD5013_3.PN and A." & pntyp & " ='" & PN & "'"
        rs.Open strsql, cn
        Range("B" & A).CopyFromRecordset rs
        rs.Close
        A = A + 1
    Loop
    cn.Close
'¥N¸¹Âà¿ï¶µ
End Sub
ù

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD