ADO Link does not work...help

J

Jaime

Hi
Could someone look at my code and let me know what I am doing wrong...

Thank
Jaim

Option Explici

Public Sub GetPartNumbers(
Dim myConn As ADODB.Connectio
Dim myRs As ADODB.Recordse
Dim selVal As Strin
Dim selRow As Intege

Set myConn = New ADODB.Connectio
myConn.ConnectionString = "Provider=IBMDA400;Data Source=xxx.xxx.x.x;User id=xxxxx;Password=xxxxx;
myConn.Ope
Set myRs = New ADODB.Recordse

Dim R As Rang
Set R = Selection(1) 'cell as range that was clicked o

If Intersect(R, Range("B14:B24")) Is Nothing The
MsgBox "You are not in Range (""B14:B24"")
Exit Su
End I

selVal = Val(R.Value) 'Returned the number in the cell associate
If selVal = 0 The
MsgBox "Select a Part Number then click on Get Part Number Command Button
Exit Su
End I

myRs.Open "QS36F/PARTDESC/setvar((&PARTNO " & selVal & "))", myCon

If myRs.RecordCount > 0 The
R.CopyFromRecordset myR
Els
R.Offset(0, 2).Value = "No Records Returned
End I

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top