Hi, I am just starting to learn ASP. I know PHP, and a bit of VB as well... I'm confused about a few things though and would really appreciate someone suggesting something... Which database handling should I learn with ASP? I know MYSQL... What about MS-ACCESS simple file databases, connected using ADO? Can I just make a ms-access file on my pc and upload it on web server, or do I sound totally stupid? While looking for some hosting providers, found that most provide MSSQL and ms-access. Kindly suggest how to continue with this... Also, can I install mssql, or sql on my xp running IIS? Thanks
Unless you have a specific need to learn ASP, learn ASP.NET instead, it makes life a lot easier as so much is done for you, although you will find classic ASP closer to PHP. Its normally best to use Microsoft SQL Server, rather than Access or MySQL, but any of them is pretty much the same in ASP apart from the database connection string. While you could just upload an MS Access file, Access isnt really designed for use in websites unless you are expecting a very low number hits. And finally use you can install SQL Server (SQL Server 2005 Express is a free product) on XP, and if your using ASP.NET 2.0 and your hosts supports SQL Express uploading your database is as it would be with access. Jen
Hi Jen, Thanks for the advise. MS-SQL is what I'm planning on as well. All the web host I have contacted so far support both ms-sql and ms-access... You are pretty right about classic asp being similar as php. I'll probably learn asp first and when good enough, will move on to asp.net BTW, do you know how to strip all html tags from a string submitted using a form? (in asp) Thanks
Try this Not 100% sure if Regex will be availble on your host if not try this one Alternate way without regex Jen
Go with MsSQL, Access only allows about 10 conncurrent connections. A tip when using Classic ASP and DB's - use GetRows - it converts to 2-dim array... and you can kill your connect to DB before anything is even rendered. I would definitely use aSP.NET - it'll flip yo' lid ASP and PHP are pretty similar, just gotta learn different syntax.
Nice! The first one works just great! Thanks for this. rep added. Just 1 more thing. Can you please tell me what's wrong with the following code. It's supposed to run a sql query to ms-access db. I think the connection is fine, as I didn't get any error message with just the connection code, but when added the query, gives me a "syntax" error... error: Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. And here's the code: ------- sql= "INSERT INTO TABLE Addresses VALUES('','first','last','location')": Conn.Execute sql ------ The values first, last etc are not "variables", but values I want in the DB. I'm also having a very hard time forming a "create table" query... Same type of syntax errors... (I'm used to creating tables using php scripts, rather than running a sql code in phpmyadmin) Thank you
Try ------- sql= "INSERT INTO Addresses VALUES('','first','last','location')": Conn.Execute sql ------ I dont think you need "TABLE", just the name of the table to be inserted into. Jen
Indeed, the TABLE keyword is not needed. A better syntax would be : sql= "INSERT INTO Addresses(firstfield,secondfield,thirdfield,fourthfield) VALUES('','first','last','location')": Conn.Execute sql firstfield,secondfield,thirdfield,fourthfield being the field names in your table where the data will go.