PDA

View Full Version : ASP



agent
14-01-2003, 05:45 PM
Is there anyone here who knows anything about Active Server Pages (and connecting to databases preferrably)? If so, please let me know here, and I will post my problem, as I see no point in posting it if no one can help.

antmannz
14-01-2003, 06:13 PM
Yep, I've done a little bit in my time

agent
14-01-2003, 06:58 PM
Sorry if this ends up long...

When I the code to access and add a new record to my database is
Dim Conn, cStr, q, addb
Set Conn = Server.CreateObject("ADODB.Connection")
cStr = "DRIVER={Microsoft Access Driver (*.mdb)};uid=;pwd=password;DBQ=" & Server.MapPath("database.mdb")
Conn.Open cStr
Set addb = Server.CreateObject("ADODB.Recordset")
q = "SELECT * FROM table"
addb.Open q, Conn, adOpenDynamic, adLockOptimistic
addb.AddNew
I get the following error:
Technical Information (for support personnel)

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/studentnet/spc/ref.asp, line 133


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Page:
POST 150 bytes to /studentnet/spc/ref.asp

POST Data:
pid=7306&firstname=firstname&lastname=lastname&email=email@domain.com&emlcnf=email@domain.com&city=auckland&password=password&passwordconfirm=password

Time:
Tuesday, 14 January 2003, 6:39:58 p.m.


More information:
Microsoft Support (http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&ID=500;100&cat=ADODB%2ERecordset&os=&over=&hrd=&Opt1=&Opt2=%2D2146825287&Opt3=Arguments+are+of+the+wrong+type%2C+are+out+of +acceptable+range%2C+or+are+in+conflict+with+one+a nother%2E)
And when the code to access and add a new record to the database is
Dim Conn, cStr, q, addb
Set Conn = Server.CreateObject("ADODB.Connection")
cStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Inetpub\wwwroot\StudentNet\spc\db\listse c.mdb;pwd=lu2i9rIzEm"
Conn.Open cStr
Set addb = Server.CreateObject("ADODB.Recordset")
q = "SELECT * FROM userlist"
addb.Open q, Conn, adOpenDynamic, adLockOptimistic
addb.AddNew
I get this error:
Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80004005)
Could not find installable ISAM.
/studentnet/spc/ref.asp, line 130


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Page:
POST 150 bytes to /studentnet/spc/ref.asp

POST Data:
pid=7306&firstname=firstname&lastname=lastname&email=email@domain.com&emlcnf=email@domain.com&city=auckland&password=password&passwordconfirm=password

Time:
Tuesday, 14 January 2003, 6:45:59 p.m.


More information:
Microsoft Support (http://www.microsoft.com/ContentRedirect.asp?prd=iis&sbp=&pver=5.0&ID=500;100&cat=Microsoft+JET+Database+Engine&os=&over=&hrd=&Opt1=&Opt2=%2D2147467259&Opt3=Could+not+find+installable+ISAM%2E)

agent
14-01-2003, 07:00 PM
I'll just be changing my database password and location now... :D

antmannz
14-01-2003, 07:40 PM
It appears to me that you will need to have:

addb.AddNew field(list), value(list)

otherwise, what are you adding??

Although in theory you should be able to use .AddNew without any parameters to create a new blank record, I think in practice it won't work, usually because some database creaters like to make some fields mandatory.

I have to say that I've never used the .AddNew statement. I've always used SQL.Execute("insert sql statement here")

I always found LearnASP (http://www.learnasp.com/learn/database.asp).

agent
14-01-2003, 08:05 PM
I just cut off the rest of the statements. They go like
addb.AddNew("user")("password")
and continue on until I update the database, close the connection, and set the Conn value to null. I'll have a look at LearnASP anyway, so thanks.

sc0ut
14-01-2003, 08:28 PM
IĎd agree with antmannz here
SQL
Iíve made a shopping cart in asp before and adding products using ASP I found was not always reliable. For some reason it would not always work (donít ask me why) but SQL was so much easier.
Currently Iím trying to make an online e-mail site, a forum, a member sites and debug my existing shopping cart (something wrong with my connection objects)

Sorry I canít real help you with your script (personally I cant make cense of other peoples code)

I found www.w3schools.com EXTREAMLY helpful for ASP and SQL

Good Luck

agent
14-01-2003, 08:40 PM
Thanks sc0ut.

But can you access a .mdb database via using SQL? I've just always thought SQL was a different database format, because of the mySQL program.

sc0ut
14-01-2003, 08:46 PM
yes you can
i cant give you an example thogh because i'm at work now, and all my asp is at home (and i don't have any SQL uploaded)

but yes SQL can acces an ACCESS database

by selecting and editing

its like you can use ASP in IIS when the computer doesn't have Access
(some things cant be explaind "because it takes too long to explain"

sc0ut
14-01-2003, 08:53 PM
PS agent
how do you get the desk top that you have
it cool
does it always update the info?
and can you get server info on it? like iis connections and ****

agent
14-01-2003, 09:45 PM
Here (http://www.sysinternals.com/ntw2k/freeware/bginfo.shtml) is the site of BGInfo, and here (http://www.sysinternals.com/files/bginfo.zip) is the direct link to download the .zip file.

You can set it to update on logon, though, because it seemed to make the default desktop the same, I took that option off and put a .com file that launched it, with the "/timer:0" so it updated the desktop immediately, in my Startup folder in the Start Menu.

I've cut out bits I don't like, but you can insert images, and it can give you other information than what I've got, like IP addresses, gateways, DHCP and DNS servers, IE version, snapshot time (the time it updated the desktop), and you could specify it to run automatically every 30 minutes or something with the Task Scheduler. You can also add in custom elements using files, vbscript, registry entries etc.

antmannz
14-01-2003, 10:00 PM
You can access Access databases with SQL as SQL is a language not a product (Structured Query Language).
You can kind of use Access to generate your sql for you. Create a query, click the dropdown arrow beside the first toolbar button and choose SQL.
Often the code that Access produces isn't always spot on , but most errors are reasonably easy to see.