UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> I am getting Error#-2147217911 (80040e09)    
 
   
sanan
post Feb 27 2005, 03:52 AM
Post#1



Posts: 76
Joined: 16-February 05



Hi there
I am getting Error#-2147217911 (80040e09)
[Microsoft ][ODBC Microsoft Access Driver] Record(s) can not be added; no insert permission on ‘SubDucumnet’
Following is the code;
Private Sub Command76_Click()
im myCn As New ADODB.Connection
Dim myRs As New ADODB.Recordset
Dim PI As Integer
PI = Forms!main.Form!Project.Form!ProjectID
myCn.ConnectionString = "Provider=MSDASQL.1;Password=bijanetak;Persist Security Info=True;Data Source=ProjectControl;Initial Catalog=C:\P2\Copy of ProjectControl"
myCn.Open
myRs.Open "INSERT INTO SubDocumnet (ProjectID) VALUES (" & PI & ");", myCn, adOpenDynamic
End Sub
The Name SubDocumnet is Correct, Even thou it is misspelled. Also Connectionstring should be correct, Since I made using a Connection Tested *.UDL File.
Best Regards
sanan
Go to the top of the page
 
truittb
post Feb 27 2005, 09:09 AM
Post#2


Retired Moderator
Posts: 13,587
Joined: 23-June 02
From: Texas (Is there anywhere else?)


CODE
no insert permission on ‘SubDucumnet’

heck the permissions on the SQL Server to see if the login has Insert permission on the SubDocumnet.
Go to the top of the page
 
sanan
post Feb 27 2005, 12:54 PM
Post#3



Posts: 76
Joined: 16-February 05



Hi truittb
Thanks so much for the comment.
But this is only a simple Access Database, and Not a SQL one, This is what it is Puzziling me.
est Regards
sanan
Go to the top of the page
 
truittb
post Feb 27 2005, 01:33 PM
Post#4


Retired Moderator
Posts: 13,587
Joined: 23-June 02
From: Texas (Is there anywhere else?)


Your Provider in the connection is not for an Access Database. Recheck it to see if it is correct.
Go to the top of the page
 
sanan
post Mar 2 2005, 11:44 AM
Post#5



Posts: 76
Joined: 16-February 05



Hi truittb
Thanks so much for the comment.
But When you say” Your Provider in the connection is not for an Access Database. Recheck it to see if it is correct.”
Are you saying it because of this line;
"Provider=MSDASQL.1;Password=bijanetak;Persist Security Info=True;Data Source=ProjectControl;Initial Catalog=C:\P2\Copy of ProjectControl"
This is very interesting since I never paid attention to these Items, Before I used to use ADO in my file rather easily, but after my recent windows XP reinstallation, I think things are changed.
Any how this is how I usually make my String;
My computer>Control Panel>Administrative Tools>Data Source (ODBC)>User DSN>Add>I choose Driver do Microsoft Access [*.mdb]>Then I give a Data source Name>Then I select my Access database Location, And Finally I make a NotePad file an Emty one, and I save it to *.UDL file. It makes a Data Link Properties File for me I can select the Provider there it looks like it has the Default selection “Microsoft OLE DB Provider for ODBC Drivers” on it already, Perhaps I should select other provider here? Do You have any Suggestions here? I should mention I tried most of them but not much of success, Finally when still in “ Data Link Properties” I can select my previously Made DSN and other selection too, and then I just Press “test Connection” Button, and if I make a Connection I just Open up the *.UDL file using the NotePad and I can Read the Connection String.
Please let me know if I am making any mistakes?
A note I just Could not make Access string most of the start with “"Provider=MSDASQL.1;Password……………..)
Best Regards
sanan
Go to the top of the page
 
truittb
post Mar 2 2005, 12:57 PM
Post#6


Retired Moderator
Posts: 13,587
Joined: 23-June 02
From: Texas (Is there anywhere else?)


Here is an example of an Access 2000 and above connection string. Don't use the ODBC Provider use the Microsoft Jet 4.0 for 2000 and higher or the Microsoft Jet 3.51 for 97.
rovider=Microsoft.Jet.OLEDB.4.0;Data Source=S:\2146Experience\Database\GroupClaimsDB.mdb;Persist Security Info=False
Go to the top of the page
 
sanan
post Mar 4 2005, 08:44 AM
Post#7



Posts: 76
Joined: 16-February 05



Hi truittb
Thanks so much for the comment.
It was very strange, Since I did not used to have much problem with ADO, “I think it has some thing to do with my changing new Windows XP”
Any how finally I had some success with it, But another Puzzling thing is that I am having problem taking Dates
Ocan transfer all the other values to my Other Tables except Dates
Following are my codes; (Just an experiment off course)
Dim PI As Integer
Dim DDD As Date
Dim CoNa As String
Dim Contactn As String
Dim myCn As New ADODB.Connection
Dim myRs As New ADODB.Recordset
ID = DMax("DocID", "SubFax")
Pcode = [Forms]![main].Form!Project.Form!ProjectCode
PI = [Forms]![main].Form!Project.Form!ProjectID
DocS = ("C:\Projects\" & Pcode & "" & ID + 1 & ".doc")
CoNa = Forms!main.Form!CompanyName
Contactn = Forms!main.Form!ContactName
DDD = Forms!main.Form!Date
PI = Forms!main.Form!Project.Form!ProjectID
myCn.ConnectionString = "Provider=MSDASQL.1;Password=bijan;Persist Security Info=True;User ID=poweradmin;Data Source=PP3;Initial Catalog=C:\Documents and Settings\BIJAN ANSARI\Desktop\PrjectControl\Copy (2) of ProjectControl"
myCn.Open
myRs.Open "INSERT INTO SubFax (ProjectID, CompanyName, LastName, doc2, Date) VALUES (" & PI & ",'" & CoNa & "','" & Contactn & "','" & DocS & "'," & DDD & ");", myCn, adOpenDynamic
tried Dim DDD as string too, But no Success,
Also I tried ,’" & DDD &”’ again no success
Best Regards
Sanan
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th October 2018 - 09:11 AM