Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Insert record or add.new


Message #1 by "Dennis Maltz" <dennis@c...> on Tue, 4 Feb 2003 18:15:59
I cannot add a record to my database.
I can extract info and I can update info, but I cannot add.
I have messed with the same code for days. I no longer
believe I know what goes where, so I am just sending it
as it appears now. Can someone please make a correction
that will stop this from erroring. I get several different
errors according to what changes I make. Can someone break
down the stucture of what goes where. My problem always seems
to be on the last line shown here. I have tried just about every
conveivable option and nothing is working. Errrors include
"type mismatch" "expected 1" and "Data Source not found and No Default 
Driver" to name a few (let me ad this one "OPEN is an unsupported" 
object). 
I have taken examples from several of your books
and have looked all over the Internet, none of the example's
variations work for me. Note that this Connection works
for other purposes, just not for adding records. And yes I have
also tried the INSERT INTO and that gives me the same problems.


Set objTour= Server.CreateObject("ADODB.Connection")
objTour.Open "DSN=people;uid=sa;pw=;", 2


DIM objInsert
Set objInsert = Server.CreateObject("ADODB.Recordset")
objInsert.Open, "ThisDayPoints", people, 2, 3
Message #2 by "Ken Schaefer" <ken@a...> on Wed, 5 Feb 2003 11:56:44 +1100
a) Why do you have a blank "sa" password?

b) When you open a connection using a DSN, you use:
objTour.Open "DSN=people"
You specify the username/password when you create the DSN

c) When you get an error, please post the exact error, and the code that
caused the error. You have several errors, but only one piece of code. How
can we tell you what the problem is if we can't see the code that caused the
error.

d) I have a FAQ that deals with several different types of Access-based
errors, here:
www.adopenstatic.com/faq/
Does any apply to your situation?

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Dennis Maltz" <dennis@c...>
Subject: [access_asp] Insert record or add.new


: I cannot add a record to my database.
: I can extract info and I can update info, but I cannot add.
: I have messed with the same code for days. I no longer
: believe I know what goes where, so I am just sending it
: as it appears now. Can someone please make a correction
: that will stop this from erroring. I get several different
: errors according to what changes I make. Can someone break
: down the stucture of what goes where. My problem always seems
: to be on the last line shown here. I have tried just about every
: conveivable option and nothing is working. Errrors include
: "type mismatch" "expected 1" and "Data Source not found and No Default
: Driver" to name a few (let me ad this one "OPEN is an unsupported"
: object).
: I have taken examples from several of your books
: and have looked all over the Internet, none of the example's
: variations work for me. Note that this Connection works
: for other purposes, just not for adding records. And yes I have
: also tried the INSERT INTO and that gives me the same problems.
:
:
: Set objTour= Server.CreateObject("ADODB.Connection")
: objTour.Open "DSN=people;uid=sa;pw=;", 2
:
:
: DIM objInsert
: Set objInsert = Server.CreateObject("ADODB.Recordset")
: objInsert.Open, "ThisDayPoints", people, 2, 3


  Return to Index