Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Adding a New Field to a Database

 
Logged in as: Guest
arrSession:exec spGetSession 2,3,450
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> ASP >> Adding a New Field to a Database
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Adding a New Field to a Database - 10/24/2001 12:25:20 PM   
  imav8n

 

Posts: 95
Score: 0
Joined: 7/3/2001
From: USA
Status: offline
I'm trying to use the objRecordSet.Fields.append method to add a new field to a database table. I'm successfully connecting to the database via ODBC, and I've got appropriate permissions on the files. In fact, this is not an .asp page, but is a stand-alone .vbs that is running on the same server as the database (MS Access) is housed on.

Has anyone else done this before successfully? I keep getting this error:

Error: Operation is not allowed in this context.
Code: 800A0C93
Source: ADODB.FIELDS

This is the code I'm using:

Set objconn = CreateObject("ADODB.Connection")
objconn.ConnectionString = "DSN=DitSize"
objconn.ConnectionTimeout = 0
objconn.open

Set objRs = CreateObject("ADODB.Recordset")
Set objRs.ActiveConnection = objConn
objRs.CursorType = adOpenDynamic
objRs.Open "DITsz", , , , adCmdTable

objRS.Fields.append "new", adDouble
objRS.Fields.update

wscript.echo "Done!"

objRS.close
Set objRS = nothing

objConn.close
Set objConn = nothing

Anybody have any idea on what I'm doing wrong??? THANKS!!!!!

~imav8n
Failure is not an option.....it comes bundled with the software.
 
 
Post #: 1
 
 Re: Adding a New Field to a Database - 10/25/2001 11:19:37 AM   
  pagooda

 

Posts: 54
Score: 0
Joined: 5/23/2001
From: USA
Status: offline
This might be related to the cursor types. Have you tried adOpenKeyset cursor?.

(in reply to imav8n)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> ASP >> Adding a New Field to a Database Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts