• Revista PROGRAMAR: Já está disponível a edição #53 da revista programar. Faz já o download aqui!

Sign in to follow this  
Followers 0

asp connect sql server 2005

1 post in this topic

How connect database in sql server with asp?

Example code:

<%@ language="javascript"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">



var CS = "Provider=SQLOLEDB.1;Integrated Security=True;Initial Catalog=mydb_2;Data Source=localhost";

var myConnection = Server.CreateObject("ADODB.Connection");


myRecordSet = myConnection.Execute("select * from person");


<table border="1">


while(!myRecordSet.eof){ %>


  for(Index=0; Index <  (myRecordSet.fields.count); Index++) {

    %> <td> <%= myRecordSet(Index) %> </td><%











Not connection!! WHY?


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0