SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: Newbie With Databases
-
Dec 5, 2001, 22:50 #1
- Join Date
- Nov 2001
- Location
- Dallas, Texas
- Posts
- 1,342
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Newbie With Databases
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
-
Dec 6, 2001, 04:08 #2
- Join Date
- Jul 2000
- Location
- Dublin , Ireland
- Posts
- 1,271
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What language are you using?
Back Again
-
Dec 6, 2001, 11:28 #3
- Join Date
- Nov 2001
- Location
- Dallas, Texas
- Posts
- 1,342
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by sbdi
What language are you using?
i'm using aspi love php
-
Dec 6, 2001, 17:10 #4
- Join Date
- Aug 2001
- Posts
- 39
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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 helpedSiteTell.com: Get the best viral marketing tool on the planet and watch as the number of unique visitors to your site soars!
-
Dec 7, 2001, 22:48 #5
- Join Date
- Nov 2001
- Location
- Dallas, Texas
- Posts
- 1,342
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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