Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]View remote data without using .DBC[/b]

Status
Not open for further replies.

roselover

Programmer
Mar 27, 2003
11
US
I'd like to view SQL data but want to avoid using a DBC. I can get as far as =SQLCONNECT('odbsource'), then I'm stuck. Would someone be able to provide me with sample code?

 
Roselover,

You need something like this:


lnConn = SQLCONNECT("MyDataSource")
IF lnConn < 0
MESSAGEBOX("Couldn't connect")
RETURN
ENDIF

lcCommand = "SELECT * FROM Customers"

lnReply = SQLEXEC(lnConn, lcCommand)
IF lnReply < 0
MESSAGEBOX("Couldn't get data from server")
ELSE
BROWSE && shows customer data
ENDIF

SQLDISCONNECT(lnConn)


This is a bit of an oversimplification, but it should get you started.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-consult.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top