ok guys, i know how to create a database from scratch, but heres my problem. how do i add/delete info from it....i'm trying to have the database collect info from visitors who visit the site...
![]()
| SitePoint Sponsor |





ok guys, i know how to create a database from scratch, but heres my problem. how do i add/delete info from it....i'm trying to have the database collect info from visitors who visit the site...
![]()
i love php





What language are you using?
Back Again





Originally posted by sbdi
What language are you using?
i'm using asp![]()
i love php
I think he means which RDBMS are you using. If you are using MS SQL Server and ASP, you firstly need to connect to the database, and then use a query/ stored proc to add/delete.
If your database is on the same machine as IIS, then you can connect like this:
<%
dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB; Data Source=(local); Initial Catalog = Pubs; User Id = sa; Password="
%>
Next, to add a record to the pubs database (a sample DB provided with MS SQL Server), use this code:
<%
dim objComm
set objComm = Server.CreateObject("ADODB.Command")
objComm.CommandText = "INSERT INTO Authors(au_lname, au_fname, phone) VALUES('Bloggs', 'Joe', '123456789012')"
objComm.Execute
%>
I have just used the ADODB COmmand object. The command object simply executes queries. You can also use the recordset.addnew() function, but it's too slow.
If you want more info on databases, checkout the sitepoint articles, or my site in my sig below.
Hope this has helped![]()
SiteTell.com: Get the best viral marketing tool on the planet and watch as the number of unique visitors to your site soars!





Originally posted by SpyderMan
I think he means which RDBMS are you using. If you are using MS SQL Server and ASP, you firstly need to connect to the database, and then use a query/ stored proc to add/delete.
If your database is on the same machine as IIS, then you can connect like this:
<%
dim objConn
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=SQLOLEDB; Data Source=(local); Initial Catalog = Pubs; User Id = sa; Password="
%>
Next, to add a record to the pubs database (a sample DB provided with MS SQL Server), use this code:
<%
dim objComm
set objComm = Server.CreateObject("ADODB.Command")
objComm.CommandText = "INSERT INTO Authors(au_lname, au_fname, phone) VALUES('Bloggs', 'Joe', '123456789012')"
objComm.Execute
%>
I have just used the ADODB COmmand object. The command object simply executes queries. You can also use the recordset.addnew() function, but it's too slow.
If you want more info on databases, checkout the sitepoint articles, or my site in my sig below.
Hope this has helped![]()
i'm using an access database.so how do i connect to it and add/delete to it...
![]()
i love php
Bookmarks