View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
AA2e72E AA2e72E is offline
external usenet poster
 
Posts: 400
Default Getting data from SQL

Try this:

1. Create your ADO connection object.
2. Set its Properties.Prompt.Value = 1 ' adPromptAlways
3. Open your Connection object

An appropriate form will open up asking for the relevant/missing information.

Sub aa()
Set adoc = CreateObject("ADODB.Connection")
adoc.Properties("Prompt").Value = 1
adoc.Open
End Sub