VB6, ADO, and writing to an Access 2000 db with user level security
Author |
Message |
Rob #1 / 5
|
 VB6, ADO, and writing to an Access 2000 db with user level security
I posted before without full and accurate information, so here we go again. This Access 2K db is using user level security (secured.mdw). I already found this article during my searches, but it doesn't address my issue of not being able to write to the db ( http://www.*-*-*.com/ ;EN-US;q191754) I can log into the db using ADO and query info, but can't write to it even if using a person with admin rights. I have MDAC 2.7 and Jet 4.0 SP6 installed. The error I receive on the rst.save line is: Run-time Error -2147286781 (80030103) Can't Save I searched the web, MS, and Google and can't find any ideas for this code to not work. Here's the code I have that lets me at least query the db and runs with no errors UNTIL it hits the rst.Save line: Dim MyConn As New ADODB.Connection, rst As ADODB.Recordset Dim strConn As String Set rst = New ADODB.Recordset strConn = "Data Source=" & txtMDB.Text & ";" & _ "Jet OLEDB:System database=" & txtMDW.Text MyConn.Provider = "Microsoft.Jet.OLEDB.4.0" MyConn.Open ConnectionString:=strConn, _ UserID:=txtLogin.Text, Password:=txtPass.Text rst.Open "select * from ContactInfo", MyConn, adOpenKeyset, adLockOptimistic Do While Not rst.EOF a = rst![Business Address 1] If InStr(a, Chr$(13) & Chr$(10)) Then rst![Business Address 1] = Replace(a, Chr$(13) & Chr$(10), txtReplaceChar) End If rst.Save rst.MoveNext Loop rst.Close MyConn.Close If I take out the rst.Save line the code works. I just thought that once I supplied the correct login info to the db that I could write if that login had the rights to do so. Let me know if u have any ideas or have code that works for this issue... Thanks! Rob Please refrain from emailing me so the other group members can gain from the info as well... -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.*-*-*.com/ The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
|
Sat, 01 Jan 2005 23:00:10 GMT |
|
 |
Chris Paterso #2 / 5
|
 VB6, ADO, and writing to an Access 2000 db with user level security
The Save method shouldn't be there. That's for saving (exporting) the recordset to a file - all you want to do is talk to the table in the database. Use the Update method instead. - Chris Paterson
Quote: > I posted before without full and accurate information, so here we go > again. > This Access 2K db is using user level security (secured.mdw). > I already found this article during my searches, but it doesn't > address my issue of not being able to write to the db > (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191754) > I can log into the db using ADO and query info, but can't write to it > even if using a person with admin rights. > I have MDAC 2.7 and Jet 4.0 SP6 installed. > The error I receive on the rst.save line is: > Run-time Error > -2147286781 (80030103) > Can't Save > I searched the web, MS, and Google and can't find any ideas for this > code to not work. > Here's the code I have that lets me at least query the db and runs > with no errors UNTIL it hits the rst.Save line: > Dim MyConn As New ADODB.Connection, rst As ADODB.Recordset > Dim strConn As String > Set rst = New ADODB.Recordset > strConn = "Data Source=" & txtMDB.Text & ";" & _ > "Jet OLEDB:System database=" & txtMDW.Text > MyConn.Provider = "Microsoft.Jet.OLEDB.4.0" > MyConn.Open ConnectionString:=strConn, _ > UserID:=txtLogin.Text, Password:=txtPass.Text > rst.Open "select * from ContactInfo", MyConn, adOpenKeyset, > adLockOptimistic > Do While Not rst.EOF > a = rst![Business Address 1] > If InStr(a, Chr$(13) & Chr$(10)) Then > rst![Business Address 1] = Replace(a, Chr$(13) & Chr$(10), > txtReplaceChar) > End If > rst.Save > rst.MoveNext > Loop > rst.Close > MyConn.Close > If I take out the rst.Save line the code works. > I just thought that once I supplied the correct login info to the db > that I could write if that login had the rights to do so. > Let me know if u have any ideas or have code that works for this > issue... > Thanks! > Rob > Please refrain from emailing me so the other > group members can gain from the info as well... > -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- > http://www.newsfeed.com The #1 Newsgroup Service in the World! > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers
=-----
|
Sat, 01 Jan 2005 23:11:54 GMT |
|
 |
Rob #3 / 5
|
 VB6, ADO, and writing to an Access 2000 db with user level security
The Update method doesn't work. On Tue, 16 Jul 2002 16:11:54 +0100, "Chris Paterson" Quote:
>The Save method shouldn't be there. That's for saving (exporting) the >recordset to a file - all you want to do is talk to the table in the >database. Use the Update method instead. > - Chris Paterson
>> I posted before without full and accurate information, so here we go >> again. >> This Access 2K db is using user level security (secured.mdw). >> I already found this article during my searches, but it doesn't >> address my issue of not being able to write to the db >> (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191754) >> I can log into the db using ADO and query info, but can't write to it >> even if using a person with admin rights. >> I have MDAC 2.7 and Jet 4.0 SP6 installed. >> The error I receive on the rst.save line is: >> Run-time Error >> -2147286781 (80030103) >> Can't Save >> I searched the web, MS, and Google and can't find any ideas for this >> code to not work. >> Here's the code I have that lets me at least query the db and runs >> with no errors UNTIL it hits the rst.Save line: >> Dim MyConn As New ADODB.Connection, rst As ADODB.Recordset >> Dim strConn As String >> Set rst = New ADODB.Recordset >> strConn = "Data Source=" & txtMDB.Text & ";" & _ >> "Jet OLEDB:System database=" & txtMDW.Text >> MyConn.Provider = "Microsoft.Jet.OLEDB.4.0" >> MyConn.Open ConnectionString:=strConn, _ >> UserID:=txtLogin.Text, Password:=txtPass.Text >> rst.Open "select * from ContactInfo", MyConn, adOpenKeyset, >> adLockOptimistic >> Do While Not rst.EOF >> a = rst![Business Address 1] >> If InStr(a, Chr$(13) & Chr$(10)) Then >> rst![Business Address 1] = Replace(a, Chr$(13) & Chr$(10), >> txtReplaceChar) >> End If >> rst.Save >> rst.MoveNext >> Loop >> rst.Close >> MyConn.Close >> If I take out the rst.Save line the code works. >> I just thought that once I supplied the correct login info to the db >> that I could write if that login had the rights to do so. >> Let me know if u have any ideas or have code that works for this >> issue... >> Thanks! >> Rob >> Please refrain from emailing me so the other >> group members can gain from the info as well... >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >==---------- >> http://www.newsfeed.com The #1 Newsgroup Service in the World! >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers >=-----
Please refrain from emailing me so the other group members can gain from the info as well... -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
|
Sun, 02 Jan 2005 09:17:48 GMT |
|
 |
Chris Paterso #4 / 5
|
 VB6, ADO, and writing to an Access 2000 db with user level security
What do you mean, "doesn't work"? Has no effect, or raises an error message? If the latter, which error message? - Chris Paterson
Quote: > The Update method doesn't work. > On Tue, 16 Jul 2002 16:11:54 +0100, "Chris Paterson"
> >The Save method shouldn't be there. That's for saving (exporting) the > >recordset to a file - all you want to do is talk to the table in the > >database. Use the Update method instead. > > - Chris Paterson
> >> I posted before without full and accurate information, so here we go > >> again. > >> This Access 2K db is using user level security (secured.mdw). > >> I already found this article during my searches, but it doesn't > >> address my issue of not being able to write to the db > >> (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191754) > >> I can log into the db using ADO and query info, but can't write to it > >> even if using a person with admin rights. > >> I have MDAC 2.7 and Jet 4.0 SP6 installed. > >> The error I receive on the rst.save line is: > >> Run-time Error > >> -2147286781 (80030103) > >> Can't Save > >> I searched the web, MS, and Google and can't find any ideas for this > >> code to not work. > >> Here's the code I have that lets me at least query the db and runs > >> with no errors UNTIL it hits the rst.Save line: > >> Dim MyConn As New ADODB.Connection, rst As ADODB.Recordset > >> Dim strConn As String > >> Set rst = New ADODB.Recordset > >> strConn = "Data Source=" & txtMDB.Text & ";" & _ > >> "Jet OLEDB:System database=" & txtMDW.Text > >> MyConn.Provider = "Microsoft.Jet.OLEDB.4.0" > >> MyConn.Open ConnectionString:=strConn, _ > >> UserID:=txtLogin.Text, Password:=txtPass.Text > >> rst.Open "select * from ContactInfo", MyConn, adOpenKeyset, > >> adLockOptimistic > >> Do While Not rst.EOF > >> a = rst![Business Address 1] > >> If InStr(a, Chr$(13) & Chr$(10)) Then > >> rst![Business Address 1] = Replace(a, Chr$(13) & Chr$(10), > >> txtReplaceChar) > >> End If > >> rst.Save > >> rst.MoveNext > >> Loop > >> rst.Close > >> MyConn.Close > >> If I take out the rst.Save line the code works. > >> I just thought that once I supplied the correct login info to the db > >> that I could write if that login had the rights to do so. > >> Let me know if u have any ideas or have code that works for this > >> issue... > >> Thanks! > >> Rob > >> Please refrain from emailing me so the other > >> group members can gain from the info as well... > >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News > >==---------- > >> http://www.newsfeed.com The #1 Newsgroup Service in the World! > >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers > >=----- > Please refrain from emailing me so the other > group members can gain from the info as well... > -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- > http://www.newsfeed.com The #1 Newsgroup Service in the World! > -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers
=-----
|
Sun, 02 Jan 2005 09:27:11 GMT |
|
 |
Rob #5 / 5
|
 VB6, ADO, and writing to an Access 2000 db with user level security
I just got it working and now I'm trying to figure out why...the Update method DOES work. Thanks for your help! Rob On Wed, 17 Jul 2002 02:27:11 +0100, "Chris Paterson" Quote:
>What do you mean, "doesn't work"? Has no effect, or raises an error message? >If the latter, which error message? > - Chris Paterson
>> The Update method doesn't work. >> On Tue, 16 Jul 2002 16:11:54 +0100, "Chris Paterson"
>> >The Save method shouldn't be there. That's for saving (exporting) the >> >recordset to a file - all you want to do is talk to the table in the >> >database. Use the Update method instead. >> > - Chris Paterson
>> >> I posted before without full and accurate information, so here we go >> >> again. >> >> This Access 2K db is using user level security (secured.mdw). >> >> I already found this article during my searches, but it doesn't >> >> address my issue of not being able to write to the db >> >> (http://support.microsoft.com/default.aspx?scid=kb;EN-US;q191754) >> >> I can log into the db using ADO and query info, but can't write to it >> >> even if using a person with admin rights. >> >> I have MDAC 2.7 and Jet 4.0 SP6 installed. >> >> The error I receive on the rst.save line is: >> >> Run-time Error >> >> -2147286781 (80030103) >> >> Can't Save >> >> I searched the web, MS, and Google and can't find any ideas for this >> >> code to not work. >> >> Here's the code I have that lets me at least query the db and runs >> >> with no errors UNTIL it hits the rst.Save line: >> >> Dim MyConn As New ADODB.Connection, rst As ADODB.Recordset >> >> Dim strConn As String >> >> Set rst = New ADODB.Recordset >> >> strConn = "Data Source=" & txtMDB.Text & ";" & _ >> >> "Jet OLEDB:System database=" & txtMDW.Text >> >> MyConn.Provider = "Microsoft.Jet.OLEDB.4.0" >> >> MyConn.Open ConnectionString:=strConn, _ >> >> UserID:=txtLogin.Text, Password:=txtPass.Text >> >> rst.Open "select * from ContactInfo", MyConn, adOpenKeyset, >> >> adLockOptimistic >> >> Do While Not rst.EOF >> >> a = rst![Business Address 1] >> >> If InStr(a, Chr$(13) & Chr$(10)) Then >> >> rst![Business Address 1] = Replace(a, Chr$(13) & Chr$(10), >> >> txtReplaceChar) >> >> End If >> >> rst.Save >> >> rst.MoveNext >> >> Loop >> >> rst.Close >> >> MyConn.Close >> >> If I take out the rst.Save line the code works. >> >> I just thought that once I supplied the correct login info to the db >> >> that I could write if that login had the rights to do so. >> >> Let me know if u have any ideas or have code that works for this >> >> issue... >> >> Thanks! >> >> Rob >> >> Please refrain from emailing me so the other >> >> group members can gain from the info as well... >> >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >> >==---------- >> >> http://www.newsfeed.com The #1 Newsgroup Service in the World! >> >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers >> >=----- >> Please refrain from emailing me so the other >> group members can gain from the info as well... >> -----------== Posted via Newsfeed.Com - Uncensored Usenet News >==---------- >> http://www.newsfeed.com The #1 Newsgroup Service in the World! >> -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers >=-----
Please refrain from emailing me so the other group members can gain from the info as well... -----------== Posted via Newsfeed.Com - Uncensored Usenet News ==---------- http://www.newsfeed.com The #1 Newsgroup Service in the World! -----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
|
Mon, 03 Jan 2005 09:16:20 GMT |
|
|
|