Unix Technical Forum

Can't add new record to ODBC in Outlook Form vbscript

This is a discussion on Can't add new record to ODBC in Outlook Form vbscript within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi! I'm trying to add a new line to a Database table via odbc from an outlook form to ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:14 PM
Marco Dieckhoff
 
Posts: n/a
Default Can't add new record to ODBC in Outlook Form vbscript

Hi!

I'm trying to add a new line to a Database table via odbc from an
outlook form to a MS SQL Server.

Read access works great, and I'm able to add data from a odbc-linked
table in Access, so the DSN configuration works.

Here's my vbscript:

Dim Dbe
Dim MyDB
Dim Rs

Set Dbe = Application.CreateObject("DAO.DBEngine.36")
Set MyDB = Dbe.workspaces(0).OpenDatabase("SQLDSN",_
0,0,"ODBC;DATABASE=DBNAME;DSN=SQLDSN")
Set Rs = MyDB.OpenRecordset("TableName")

Rs.MoveLast
Rs.AddNew

Everything goes well up to the AddNew.
There I get a error message saying

Unable to update; Database or object is read-only.

(actually I get the german error message "Aktualisieren nicht
möglich; Datenbank oder Objekt ist schreibgeschützt.", I tried to
translate as good as I can)

The line of the error is the Rs.AddNew-Command.

Can anybody tell me what's wrong with my script?

--
Marco Dieckhoff
icq# 22243433
GPG Key 0x1A6C95BA -- http://www.frankonia-brunonia.de/keys
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:07 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com