PC Review


Reply
Thread Tools Rate Thread

Connection String with Access Workgroup Info (mdw)

 
 
Duppypog
Guest
Posts: n/a
 
      14th Aug 2003
I've searched through several forums without finding a definitive answer to
this question:

What is the proper syntax for a connection string that is connecting to an
Access 97 db with workgroup security applied?

I tried the following. I don't get an error, but it also displays NO
results:

Public Shared ReadOnly OleDbConnectionString As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DBQ=c:\CORmandOTweb\NewSecure
CORMandatoryOTList.mdb
SystemDB=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corrections.mdw;UID=usern
ame;PWD=anything"

Also tried:

Dim cnn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
Info=false;Data Source=" &
System.Web.HttpContext.Current.Server.MapPath("/CORmandOTweb/NewSecure
CORMandtoryOTList.mdb") & "; Jet OLEDB:System
Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corrections.mdw;UserID=us
ername;Password=anything")


All help will be greatly appreciated!
Lynnette



 
Reply With Quote
 
 
 
 
Duppypog
Guest
Posts: n/a
 
      15th Aug 2003
Andy, Thanks. I had to change line 3 to "Data Source=" instead of just
"Source=". I need to change the data source to point to a virtual
directory. I tried this code and it returned no error, but no data either.
Can you (or anyone) spot the problem?

Dim cnn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _

"Data Source=" &
System.Web.HttpContext.Current.Server.MapPath("/CORmandOTweb/NewSecure
CORMandtoryOTList.mdb") & "; " & _

"Jet OLEDB:System
Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corrections.mdw; " & _

"User id=dbadmin; Password=jaxkdbadmin;")


Thanks again,
Lynnette




"Andy S." <(E-Mail Removed)> wrote in message
news:0f3501c36276$cf3de970$(E-Mail Removed)...
> Sorry Lynnette, I had a syntax error also...so here is
> the repost...
>
> Dim strConnection as String = _
> "Provider=Microsoft.Jet.OLEDB.4.0; " & _
> "Source=\your path\yourdb.mdb; " & _
> "Jet OLEDB:System Database=\pathto.mdw\yourdb.mdw; " & _
> "User id=yourid; Password=yourpassword;"
>
> Sorry about that...
>
> Andy S.
> >-----Original Message-----
> >Lynnette,
> >
> >The following syntax should work...
> >
> >Dim strConnection as String = _
> > "Provider=Microsoft.Jet.OLEDB.4.0; " & _
> > "Source=\your path\yourdb.mdb; " & _
> > "Jet OLEDB:System Database=\path

> to .mdw\yourdb.mdw; "
> > "User id=yourid; Password=yourpassword;"
> >
> >Looking at the syntax you've written, you had a

> semicolon
> >missing after password...
> >
> >Good luck...
> >
> >Andy S.
> >>-----Original Message-----
> >>Hi
> >>Check with the following Connection Strings:
> >>
> >> Workgroup (system database):
> >>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >>Source=\somepath\mydb.mdb;Jet OLEDB:System
> >>Database=system.mdw;","admin", ""
> >>
> >>
> >> With password:
> >>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >>Source=\somepath\mydb.mdb;Jet OLEDBatabase
> >>Password=MyDbPassword;","admin", ""
> >>
> >>
> >>HTH
> >>Ravikanth[MVP]
> >>
> >>
> >>>-----Original Message-----
> >>>I've searched through several forums without finding a
> >>definitive answer to
> >>>this question:
> >>>
> >>>What is the proper syntax for a connection string that
> >>is connecting to an
> >>>Access 97 db with workgroup security applied?
> >>>
> >>>I tried the following. I don't get an error, but it

> >also
> >>displays NO
> >>>results:
> >>>
> >>>Public Shared ReadOnly OleDbConnectionString As String

> =
> >>>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >>Source=DBQ=c:\CORmandOTweb\NewSecure
> >>>CORMandatoryOTList.mdb
> >>>SystemDB=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corr

> e
> >c
> >>tions.mdw;UID=usern
> >>>ame;PWD=anything"
> >>>
> >>>Also tried:
> >>>
> >>>Dim cnn As OleDbConnection = New
> >>>OleDbConnection
> >>("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
> >>>Info=false;Data Source=" &
> >>>System.Web.HttpContext.Current.Server.MapPath
> >>("/CORmandOTweb/NewSecure
> >>>CORMandtoryOTList.mdb") & "; Jet OLEDB:System
> >>>Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corr

> e
> >c
> >>tions.mdw;UserID=us
> >>>ername;Password=anything")
> >>>
> >>>
> >>>All help will be greatly appreciated!
> >>>Lynnette
> >>>
> >>>
> >>>
> >>>.
> >>>
> >>.
> >>

> >.
> >



 
Reply With Quote
 
 
 
 
Duppypog
Guest
Posts: n/a
 
      18th Aug 2003
Thanks for all your help. I will post the procedure for your review.
Lynnette


This code works:
Private Sub Datafill()
Dim da As OleDbDataAdapter

Dim ds As DataSet

Dim strSQL As String

Select Case Me.rblView.SelectedItem.Value

Case "1st Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='1' ORDER BY exempt DESC,
LastWorked ASC, HireDate DESC"

Case "2nd Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='2' ORDer BY exempt DESC,
LastWorked ASC, HireDate DESC"

Case "3rd Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='3' ORDER BY exempt DESC,
LastWorked ASC, HireDate DESC"

End Select

Dim cnn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _

"Data Source=C:\Inetpub\wwwroot\ASPdotNET\CORmandOT\db\NewSecure
CORMandatoryOTList.mdb; " & _

"Jet OLEDB:System
Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corrections.mdw; " & _

"User id=dbadmin; Password=jaxkdbadmin;")

Try

cnn.Open()

da = New OleDbDataAdapter(strSQL, cnn)

ds = New DataSet()

da.Fill(ds, "tblVolunteer_list")

Session("DataView") = ds.Tables("tblVolunteer_list").DefaultView()

Catch

'lblError.Text = e.ToString

Finally

cnn.Close()

cnn.Dispose()

End Try

End Sub

This code does NOT work (but I don't know why):
Private Sub Datafill()

Dim da As OleDbDataAdapter

Dim ds As DataSet

Dim strSQL As String

Select Case Me.rblView.SelectedItem.Value

Case "1st Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='1' ORDER BY exempt DESC,
LastWorked ASC, HireDate DESC"

Case "2nd Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='2' ORDer BY exempt DESC,
LastWorked ASC, HireDate DESC"

Case "3rd Shift"

strSQL = "Select VolunteerID, Name, SquadODG, LastWorked, exempt, HireDate,
shift, LOC_NAME From tblVolunteer_list WHERE shift='3' ORDER BY exempt DESC,
LastWorked ASC, HireDate DESC"

End Select

Dim DataPath As String =
System.Web.HttpContext.Current.Server.MapPath("NewSecure
CORMandatoryOTList.mdb") 'also tried "/CORmandOT/NewSecure
CORMandatoryOTList.mdb"

Dim cnn As OleDbConnection = New
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _

"Data Source=" & DataPath & "; " & _

"Jet OLEDB:System
Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corrections.mdw; " & _

"User id=dbadmin; Password=jaxkdbadmin;")

Try

cnn.Open()

da = New OleDbDataAdapter(strSQL, cnn)

ds = New DataSet()

da.Fill(ds, "tblVolunteer_list")

Session("DataView") = ds.Tables("tblVolunteer_list").DefaultView()

Catch

'lblError.Text = e.ToString

Finally

cnn.Close()

cnn.Dispose()

End Try

End Sub



<(E-Mail Removed)> wrote in message
news:09ba01c3659a$e9fe4530$(E-Mail Removed)...
> Lynnette,
>
> If you didn't have any problem with the connection and if
> you didn't receive any data back from your database then
> this could only be one thing...Your Data Selection method.
> Check to make sure your selection criteria is set
> correctly. Your Dataset is empty due to your selection
> criteria you've set did not match what is in your
> database...Recheck your SQL Selection ceriteria...Any
> further problems, you might want to post your SQL
> selection command...
>
> Andy S.
>
>
> >-----Original Message-----
> >Andy, Thanks. I had to change line 3 to "Data Source="

> instead of just
> >"Source=". I need to change the data source to point to

> a virtual
> >directory. I tried this code and it returned no error,

> but no data either.
> >Can you (or anyone) spot the problem?
> >
> >Dim cnn As OleDbConnection = New
> >OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
> >
> >"Data Source=" &
> >System.Web.HttpContext.Current.Server.MapPath

> ("/CORmandOTweb/NewSecure
> >CORMandtoryOTList.mdb") & "; " & _
> >
> >"Jet OLEDB:System
> >Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\correc

> tions.mdw; " & _
> >
> >"User id=dbadmin; Password=jaxkdbadmin;")
> >
> >
> >Thanks again,
> >Lynnette
> >
> >
> >
> >
> >"Andy S." <(E-Mail Removed)> wrote in

> message
> >news:0f3501c36276$cf3de970$(E-Mail Removed)...
> >> Sorry Lynnette, I had a syntax error also...so here is
> >> the repost...
> >>
> >> Dim strConnection as String = _
> >> "Provider=Microsoft.Jet.OLEDB.4.0; " & _
> >> "Source=\your path\yourdb.mdb; " & _
> >> "Jet OLEDB:System Database=\pathto.mdw\yourdb.mdw; "

> & _
> >> "User id=yourid; Password=yourpassword;"
> >>
> >> Sorry about that...
> >>
> >> Andy S.
> >> >-----Original Message-----
> >> >Lynnette,
> >> >
> >> >The following syntax should work...
> >> >
> >> >Dim strConnection as String = _
> >> > "Provider=Microsoft.Jet.OLEDB.4.0; " & _
> >> > "Source=\your path\yourdb.mdb; " & _
> >> > "Jet OLEDB:System Database=\path
> >> to .mdw\yourdb.mdw; "
> >> > "User id=yourid; Password=yourpassword;"
> >> >
> >> >Looking at the syntax you've written, you had a
> >> semicolon
> >> >missing after password...
> >> >
> >> >Good luck...
> >> >
> >> >Andy S.
> >> >>-----Original Message-----
> >> >>Hi
> >> >>Check with the following Connection Strings:
> >> >>
> >> >> Workgroup (system database):
> >> >>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >> >>Source=\somepath\mydb.mdb;Jet OLEDB:System
> >> >>Database=system.mdw;","admin", ""
> >> >>
> >> >>
> >> >> With password:
> >> >>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >> >>Source=\somepath\mydb.mdb;Jet OLEDBatabase
> >> >>Password=MyDbPassword;","admin", ""
> >> >>
> >> >>
> >> >>HTH
> >> >>Ravikanth[MVP]
> >> >>
> >> >>
> >> >>>-----Original Message-----
> >> >>>I've searched through several forums without

> finding a
> >> >>definitive answer to
> >> >>>this question:
> >> >>>
> >> >>>What is the proper syntax for a connection string

> that
> >> >>is connecting to an
> >> >>>Access 97 db with workgroup security applied?
> >> >>>
> >> >>>I tried the following. I don't get an error, but it
> >> >also
> >> >>displays NO
> >> >>>results:
> >> >>>
> >> >>>Public Shared ReadOnly OleDbConnectionString As

> String
> >> =
> >> >>>"Provider=Microsoft.Jet.OLEDB.4.0;Data
> >> >>Source=DBQ=c:\CORmandOTweb\NewSecure
> >> >>>CORMandatoryOTList.mdb
> >>
> >>>SystemDB=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corr
> >> e
> >> >c
> >> >>tions.mdw;UID=usern
> >> >>>ame;PWD=anything"
> >> >>>
> >> >>>Also tried:
> >> >>>
> >> >>>Dim cnn As OleDbConnection = New
> >> >>>OleDbConnection
> >> >>("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security
> >> >>>Info=false;Data Source=" &
> >> >>>System.Web.HttpContext.Current.Server.MapPath
> >> >>("/CORmandOTweb/NewSecure
> >> >>>CORMandtoryOTList.mdb") & "; Jet OLEDB:System
> >>
> >>>Database=c:\inetpub\wwwroot\aspdotnet\cormandot\db\corr
> >> e
> >> >c
> >> >>tions.mdw;UserID=us
> >> >>>ername;Password=anything")
> >> >>>
> >> >>>
> >> >>>All help will be greatly appreciated!
> >> >>>Lynnette
> >> >>>
> >> >>>
> >> >>>
> >> >>>.
> >> >>>
> >> >>.
> >> >>
> >> >.
> >> >

> >
> >
> >.
> >



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String To Access With Workgroup File Joe Microsoft ADO .NET 6 12th Dec 2008 05:54 AM
Unable to open *View Workgroup Computers* nor access workgroup jinnii Windows XP Networking 11 20th Sep 2006 01:19 AM
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft Dot NET 7 12th Nov 2004 10:08 AM
Cannot access Workgroup/Workgroup computers mare Windows XP Networking 0 14th Jul 2004 11:07 PM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Frank Oquendo Microsoft C# .NET 0 31st Jul 2003 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:32 PM.