General discussion

Locked

data base connection in COM+ componenr

By mastoyo ·
Why I Can't connect to my data base in my COM+ application. My COM+ application give good reponse while it was accessed but not its connection to database

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

data base connection in COM+ componenr

by chris.wolfe In reply to data base connection in C ...

It's not possible to give a definitive answer to the question you've posed as there are no details; however, the follow code snippit (in VB) will return a recordset from a query to the Authors table in the SQL Server Pubs database. If your COM+ component were to return a ADODB.Recordset object, you could iterate through the Recordset in the client and check the results.
--------------------------------------
dim strSQL
dim strConnectString
dim cnPubs
dim rstAuthors

set cnPubs = Server.CreateObject("ADODB.Connection")

strConnectString = "DRIVER={SQL Server};"
strConnectString = strConnectString & "SERVER=(local);DATABASE=pubs;UID=sa;PWD=;"

strSQL = "SELECT au_lname, au_fname FROM AUTHORS"

cnPubs.Open strConnectString

set rstAuthors = Server.CreateObject("ADODB.Recordset")
rstAuthors.Open strSQL, cnPubs, 3, 1
if not (rstAuthors.BOF and rstAuthors.EOF) then
rstAuthors.MoveLast
rstAuthors.MoveFirst
end if
--------------------------------------
Regards,Chris Wolfe
Idea In

Collapse -

data base connection in COM+ componenr

by mastoyo In reply to data base connection in C ...
Back to Desktop Forum
2 total posts (Page 1 of 1)  

Hardware Forums