• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

ASP / MS SQL help for a site

cw42

Diamond Member
Any idea why I can't anything from my table to output onto the page?

<%

Dim objConn

Set objConn = Server.CreateObject("ADODB.Connection")

objConn.ConnectionString = "DRIVER={SQL Server}; SERVER=xxx.xxx.xxx.; DATABASE=myDB; UID=myUID; PWD=myPW;"

objConn.open

DIM sSQL
sSQL = "SELECT * FROM names"

DIM objRS
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open sSQL, objConn

%>

<html>
<head>

</head>
<body>

Test


</body>
</html>
 
Not that I know much about VB but your code doesn't even seem to be echoing/printing/writing/dunnoing anything to the page. When you find out how to do that, you may also wish to move the content to the body.
 
You are missing looping round the recordset, eg:

Do While Not objRS.EOF

Response.Write(objRS("FieldName"))
objRS.MoveNext

Loop
 
Back
Top