f



Forms and Control Question

Can someone please tell/show me how I would do the following...

I have a table called tblOne. In tblOne I have three fields, two, three, 
four.

I have a form called frmMain. I have three blank controls on the form. I 
want to assign the names from the table to the controls on the form, ex. 
ctlfive displays two's data, and so on. Does that make sense to anyone?

I want to do this with VBA. The reason is that I will have other tables and 
I want to use as few forms as possible so I setup up a form with many 
controls and I turn off the ones that I do not need.

The ones I do need, I need to assign to the table columns.

Thanks for any help on this...

Mike
m charney at sbc global dot net 


0
me2025 (20)
1/15/2007 3:27:58 PM
comp.databases.ms-access 42670 articles. 0 followers. Post Follow

8 Replies
264 Views

Similar Articles

[PageSpeed] 54

I guess you could do this through setting the record source of the form
and the control sources of the controls, although it is probably not
example of good coding.

E.g.
frmMain.RecordSource = "tblOne"
frmMain.ctlFive = "fldTwo"
....

0
1/15/2007 4:09:49 PM
I can do that but with 24 fieds on tne form it can be a lot of programming.

I was wondering if there was a way to loop through and have them assign that 
way. Lots less programming lines.

Mike

"Mike" <michael.matthys@hotmail.com> wrote in message 
news:1168877388.011015.82250@q2g2000cwa.googlegroups.com...
>I guess you could do this through setting the record source of the form
> and the control sources of the controls, although it is probably not
> example of good coding.
>
> E.g.
> frmMain.RecordSource = "tblOne"
> frmMain.ctlFive = "fldTwo"
> ...
> 


0
me2025 (20)
1/15/2007 4:11:58 PM
What you could do is store the information in some kind of master table
and then loop through the information and assign the field-values to
the corresponding controls.

0
1/15/2007 4:26:47 PM
SBC News Groups wrote:

> I have a form called frmMain. I have three blank controls on the form. I 
> want to assign the names from the table to the controls on the form, ex. 
> ctlfive displays two's data, and so on. Does that make sense to anyone?
> 
> I want to do this with VBA. The reason is that I will have other tables and 
> I want to use as few forms as possible so I setup up a form with many 
> controls and I turn off the ones that I do not need.

 From a development point of view, it's probably a more cost effective 
use of your time to simply copy the form and save it under a different 
name, change the recordsource table and controlsources of the text 
boxes/form controls.

The question that comes to my mind is are you sure you've designed your 
data structure properly?  The first thing that pops up with a red flag 
is it sounds as if the different tables might actually all be the 
same...  Do not have tables with the same structure and types of data. 
It's a stupid butthead like method of doing things.

Otherwise, I would use openargs on the form to populate stuff.  The 
following is air code.

Given tables tbl_stuff, tbl_other_stuff, tbl_things, all with different 
fields and frmMain with UNBOUND text boxes txtA, txtB, txtC

Have a calling form with three buttons:

btnStuff with Caption "Data Enter Stuff" and on click event:
  docmd.OpenForm "frmMain",,,,,,"Stuff"

btnOtherStuff with Caption "Data Enter Other Stuff" and on click event:
  docmd.OpenForm "frmMain",,,,,,"OtherStuff"

btnThings with Caption "Data Enter Things" and on click event:
  docmd.OpenForm "frmMain",,,,,,"Things"

frmMain would need code similar to the following for the on open event.

Option Compare Database
Option Explicit

Private Sub Form_Open(Cancel As Integer)

select case me.openargs

   Case "Stuff"
     me.recordsource = "tbl_Stuff" 'the name of the table
     me.txtA.controlsource = "=Two"
     me.txtB.controlsource = "=Three"
     me.txtC.controlsource = "=Four"
   Case "OtherStuff"
     me.recordsource = "tbl_Other_Stuff" 'the name of the table
     me.txtA.controlsource = "=Two"
     me.txtB.controlsource = "=Three"
     me.txtC.controlsource = "=Four"
   Case "Things"
     me.recordsource = "tbl_Things" 'the name of the table
     me.txtA.controlsource = "=Two"
     me.txtB.controlsource = "=Three"
     me.txtC.controlsource = "=Four"

end select

end sub

Again, IF YOU HAVE MULTIPLE TABLES WITH THE SAME INFORMATION IN THE 
FIELDS, YOUR DATA DESIGN IS SHAGGED UP, PERIOD.

-- 
Tim    http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto  "TIM-MAY!!" - Me
0
Tim
1/15/2007 4:36:35 PM
That would be duplicating information that is already in teh DB.

I know there has to be a way to do this, I just can't seem to figure it out.

Thanks anyway.

Mike

"Mike" <michael.matthys@hotmail.com> wrote in message 
news:1168878404.812356.168100@m58g2000cwm.googlegroups.com...
> What you could do is store the information in some kind of master table
> and then loop through the information and assign the field-values to
> the corresponding controls.
> 


0
me2025 (20)
1/15/2007 4:45:44 PM
Hi Tim,

No I have different tables and they do not have the same information in 
them. One is customer data, one is clerk data, one is consignor data. I 
wanted to use the same form and just reassign the controls based on the 
records source.

Me.RecordSource = "tblCustomers"

I started to program that code the way you have it but it gets really long 
with 24 different text/lable controls, buttons and other misc things. I have 
to change the TOP, LEFT, WIDTH on each control.

I wanted to make just one form, but I guess it is looking like I might not 
be able to do that.

Thanks,

Mike.

"Tim Marshall" <TIMMY!@PurplePandaChasers.Moertherium> wrote in message 
news:eogaij$doq$1@coranto.ucs.mun.ca...
> SBC News Groups wrote:
>
>> I have a form called frmMain. I have three blank controls on the form. I 
>> want to assign the names from the table to the controls on the form, ex. 
>> ctlfive displays two's data, and so on. Does that make sense to anyone?
>>
>> I want to do this with VBA. The reason is that I will have other tables 
>> and I want to use as few forms as possible so I setup up a form with many 
>> controls and I turn off the ones that I do not need.
>
> From a development point of view, it's probably a more cost effective use 
> of your time to simply copy the form and save it under a different name, 
> change the recordsource table and controlsources of the text boxes/form 
> controls.
>
> The question that comes to my mind is are you sure you've designed your 
> data structure properly?  The first thing that pops up with a red flag is 
> it sounds as if the different tables might actually all be the same...  Do 
> not have tables with the same structure and types of data. It's a stupid 
> butthead like method of doing things.
>
> Otherwise, I would use openargs on the form to populate stuff.  The 
> following is air code.
>
> Given tables tbl_stuff, tbl_other_stuff, tbl_things, all with different 
> fields and frmMain with UNBOUND text boxes txtA, txtB, txtC
>
> Have a calling form with three buttons:
>
> btnStuff with Caption "Data Enter Stuff" and on click event:
>  docmd.OpenForm "frmMain",,,,,,"Stuff"
>
> btnOtherStuff with Caption "Data Enter Other Stuff" and on click event:
>  docmd.OpenForm "frmMain",,,,,,"OtherStuff"
>
> btnThings with Caption "Data Enter Things" and on click event:
>  docmd.OpenForm "frmMain",,,,,,"Things"
>
> frmMain would need code similar to the following for the on open event.
>
> Option Compare Database
> Option Explicit
>
> Private Sub Form_Open(Cancel As Integer)
>
> select case me.openargs
>
>   Case "Stuff"
>     me.recordsource = "tbl_Stuff" 'the name of the table
>     me.txtA.controlsource = "=Two"
>     me.txtB.controlsource = "=Three"
>     me.txtC.controlsource = "=Four"
>   Case "OtherStuff"
>     me.recordsource = "tbl_Other_Stuff" 'the name of the table
>     me.txtA.controlsource = "=Two"
>     me.txtB.controlsource = "=Three"
>     me.txtC.controlsource = "=Four"
>   Case "Things"
>     me.recordsource = "tbl_Things" 'the name of the table
>     me.txtA.controlsource = "=Two"
>     me.txtB.controlsource = "=Three"
>     me.txtC.controlsource = "=Four"
>
> end select
>
> end sub
>
> Again, IF YOU HAVE MULTIPLE TABLES WITH THE SAME INFORMATION IN THE 
> FIELDS, YOUR DATA DESIGN IS SHAGGED UP, PERIOD.
>
> -- 
> Tim    http://www.ucs.mun.ca/~tmarshal/
> ^o<
> /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
> /^^ "Be Careful, Big Bird!" - Ditto  "TIM-MAY!!" - Me 


0
me2025 (20)
1/15/2007 5:13:29 PM
SBC News Groups wrote:

> I started to program that code the way you have it but it gets really long 
> with 24 different text/lable controls, buttons and other misc things. I have 
> to change the TOP, LEFT, WIDTH on each control.
> 
> I wanted to make just one form, but I guess it is looking like I might not 
> be able to do that.

If you're going to need to change widths and other appearance 
characteristics, it's really much easier to go with different forms, 
IMO.  8)
-- 
Tim    http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto  "TIM-MAY!!" - Me
0
Tim
1/15/2007 5:17:27 PM
"SBC News Groups" <me@you.net> wrote

 > No I have different tables and they do not have the same information in
 > them. One is customer data, one is clerk data, one is consignor data. I
 > wanted to use the same form and just reassign the controls based on the
 > records source.
 >
 > Me.RecordSource = "tblCustomers"

What you want to do can be done, but it does not allow you to use the 
appropriate kind of Controls for different types of data, so if your Fields 
are not all text Fields with individually entered text, it is unlikely to be 
user-friendly. And, if they are, it will still be, at best, difficult to 
adjust the size of the displayed Controls to the underlying data... unlike 
Reports, the "CanGrow" and "CanShrink" properties you see on Controls on 
Forms do not work.

But, since this is "only" a matter of usability, rather than a matter of 
design that will eventually "rise up to bite you in the tender places", the 
following VBA code does what you want for a form with six Labels and six 
Text Boxes... for Tables with fewer Fields, the remaining Labels are blank 
and the remaining Text Boxes empty. If I were doing this for real, live 
users, I'd certainly at least make any unused text boxes invisible.

But, before you get excited about a method that works, let me repeat, your 
users will not thank you for using such a method for your own convenience --  
and I suspect, in time, that will be true even if you are the only user.

The name of the underlying Table or Query is passed as a text string in the 
OpenArgs argument of a DoCmd.OpenForm, and the following event code in the 
"General Form" works for me. You'll need to add your own error handling, 
etc.:

  Private Sub Form_Open(Cancel As Integer)
      Me.RecordSource = Me.OpenArgs
  End Sub

  Private Sub Form_Load()
      Dim rs As DAO.Recordset
      Dim i As Integer, intMax As Integer
      Set rs = Me.RecordsetClone
      intMax = IIf((rs.Fields.Count - 1) > 5, 5, rs.Fields.Count - 1)
      For i = 0 To intMax
          Me("Label" & Format((i + 1), "#0")).Caption = rs.Fields(i).Name
          Me("TextBox" & Format((i + 1), "#0")).ControlSource = 
rs.Fields(i).Name
      Next i
      rs.Close
      Set rs = Nothing
  End Sub

and, you could do the Form_Load code in fewer lines by using 
Me.RecordsetClone directly, but this seemed more readable to me.

  Larry Linson
  Microsoft Access MVP


0
bouncer (4168)
1/15/2007 10:00:41 PM
Reply:

Similar Artilces:

Form size question with Access forms, remote desktop, and MS Surface Pro
Hi, I know this is a stretch to ask this question, but: We have an Access 2010 application hosted using Remote Desktop. When we access forms from the desktop they look like they should. And from an iPad. However, a client is using their Surface Pro the forms are so tiny that she can't use them when accessing our application "on the cloud". Otherwise, they look fine on a Surface Pro when running it off the cloud. Does anyone have an idea? I do not think there is anything that the people that are hosting our software can do. -paulw On Monday, 29 February 2016 17:30:11 UTC, PW wrote: > Hi, > > I know this is a stretch to ask this question, but: > > We have an Access 2010 application hosted using Remote Desktop. When > we access forms from the desktop they look like they should. And from > an iPad. However, a client is using their Surface Pro the forms are > so tiny that she can't use them when accessing our application "on the > cloud". Otherwise, they look fine on a Surface Pro when running it > off the cloud. > > Does anyone have an idea? I do not think there is anything that the > people that are hosting our software can do. > > -paulw It will cost you, but have a look at a program called "ShrinkerStrether from Peter's Software (http://www.peterssoftware.com/ss.htm) This should shrink or stretch forms and all their controls to match the scr...

Form layout question: How move controls in a Form to (in) a Tab Control?
Hi, I created a form with a lot of controls on it. (textboxes, pulldown's etc.) Because the form is a little full I want to move the controls to different pages on a tab control. HOW can one do this?. If I drag them the tab control is not 'activated' if the mouse pointer is above the tab control. (if one creates a new textbox and place it on the tab control this tab control page turns black to show it's activated) This does not work while dragging??! Thanks in advance, Eddie Smit Holland. (The Netherlands) >Because the form is a little full I want to move the >control...

ask me a question ms access databases
I will be willing to help, with access databases, in same order request is received. The web site is at www.jaxdatasolutions.com. This is for a limited time only. ivanmendoza@comcast.net (Ivan) wrote: >I will be willing to help, with access databases, in same order >request is received. The web site is at <snipped> This >is for a limited time only. Umm, hows about we ask questions in this newsgroup? Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can read the entire thread of messages. Microsoft Access Links, Hints, Tips &...

Forms/Subforms in MS Access Database
Why do my Forms/Subforms in my MS Access Database not appear? All I see is the boxes where they should show?! What did I do wrong? Thanks, John zufie wrote: > Why do my Forms/Subforms in my MS Access Database not appear? > > All I see is the boxes where they should show?! > > What did I do wrong? -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Probably there isn't a name of a form in the sub-form's Source Object property. Also, the Link Child Fields and the Link Master Fields properties may be blank - you must enter the names of the link fields, they hold the field names that link the data between the forms. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ** Respond only to this newsgroup. I DO NOT respond to emails ** -----BEGIN PGP SIGNATURE----- Version: PGP for Personal Privacy 5.0 Charset: noconv iQA/AwUBSSsUjoechKqOuFEgEQL+dQCfYUSwXFtPj0RRSZO+q3J8lQCD0/UAniRz JKu0h9AG0BAg8W3wC/0BC7B3 =Kvva -----END PGP SIGNATURE----- On Nov 24, 2:54=A0pm, MGFoster <m...@privacy.com> wrote: > zufie wrote: > > Why do my Forms/Subforms in my MS Access Database not appear? > > > All I see is the boxes where they should show?! > > > What did I do wrong? > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Probably there isn't a name of a form in the sub-form's Source Object > property. =A0Also, the Link Child Fields and the Link Master Fields > properties...

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but...

paltalk MS ACCESS, general database questions
This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C7AAE9.97F77F70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable www.Paltalk.com: Welcome to the ms access database programmer Group = unsha ------=_NextPart_000_0007_01C7AAE9.97F77F70 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Diso-8859-1"> <META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV> <P><FONT face=3DArial>www.<A = href=3D"http://Paltalk.com">Paltalk.com</A>: Welcome to=20 the ms access database programmer Group = unsha</FONT></P></DIV></BODY></HTML> ------=_NextPart_000_0007_01C7AAE9.97F77F70-- ...

MS Access Question for Access Gurus
I have one table called Album another table called Song One Album has many songs I created an Album form that contains a Song Subform. in the Song table I have a field id which is the primary key, and another field called index The song index is a number that represents the song number on the record. For example on the Beatle's Album: Abbey Road the song indices are as follows: Track Listings 1. Come Together 2. Something 3. Maxwell's Silver Hammer 4. Oh! Darling 5. Octopus's Garden 6. I Want You (She's So Heavy) 7. Here Comes the Sun ...

Re: help SAS/MS ACCESS, general database questions
Without having enough time to analyze excatly, what are your needs: if there are no important reasons why the data must be keept in MS Access: why you don't keep it all in SAS? If you are analyzing in SAS, there is no real reason to have any other DB to hold the data. For users you have many possibilities to give them comfortable possibilities to enter data, in or outside SAS. In SAS, the most easy idea is to use SAS/FSP. But that is not necessary. You can use nearly any tool for data entry and bring the (standard formatted) data into SAS. To get a consultant for realizing a proper solution might be a good idea. It sometime is not easy trying to learn to program in SAS by developing a productive solution, because it might be not easy to get it in time with all the obstacles, there might be in your way. If you have time (and money) enough, you should take the chance to learn how to do some steps further in SAS programming together with a good consultant. On Tue, 2 Mar 2004 10:26:59 -0500, Rob Cheshire <rob.cheshire@NOAA.GOV> wrote: >Hi to all, > I need some help deciding on the best database system for our >specific application. >OPTIONAL INFO: We currently have 2 separate projects that need to be >updated from dos-based dBase. I'll only describe one of these but the >other is comparable in size. The project currently has about 32 >files. The 2 largest are about 30,000 records and 5 columns include >data from the last 30 yea...

Open Form in Ms-Access from a hyperlink by using dhtml control
Hey ! I'm having a little ms-access application problem. in form A I have a dhtml control which I'm trying to assign it's documentHtml property a html string. I want that the html string will contain a hyperlink which open another form in access. Can I do that ? David ...

Re: help SAS/MS ACCESS, general database questions #2
You're describing my project with the Department of Education! We had a dbase database and used a Clipper application to massage it into 'presentable' form. And I thought I was on the bleeding edge (back edge, that is) 8 years ago. As with everything, it depends on what your main purpose is. In my case, it was to disseminate the information to as many people as possible in a format that could be read by/into as many applications as possible. So, we converted our data to flat files and supplied an 'application' that generated sas code that would read the flat files into a sas dataset (complete with formats and labels), so the researcher could write their own code to run against the sas dataset. It sounds like your project isn't quite as ambitious, but the reason I include this example is that it's hard to predict what form data will take, say, 5 years from now. I'll bet you've already run into difficulties in using Clipper, and you'd like to avoid these kind of problems the next time you update/analyze your data. Sas has had some changes in going from one version to another--generally, upgrading to the next version involves updating your dataset to the next version's format. So, if you're purpose is to archive your data for the next iteration of your survey, unless you're going to be active in the data, sas might not be the best choice for data storage. Somewhat more stable would be something like SQL server (cheap, ...

Re: help SAS/MS ACCESS, general database questions #3
Rob: MS Access imports data easily from dBase (*.dbf) files. I see no advantage in moving to SAS for that feature, especially if you would prefer to use the basic DE form controls in MS Access to develop what should be a simple DE capability. Although ODBC transfers of data from MS Access (*.mdb) databases has some pitfalls, as does OLEdb or other middleware (in particular, conversions of integers to floating point numbers, date/time values, and nulls/missings), a bit of Q/C will help you iron out the wrinkles and set up a reliable connection. It often helps as well to separate a data collection operation from a data analysis group. Even on a small scale, periodic publishing of analytic datasets usually works better than giving researchers continuous access to primary data files. Continuous access makes it more difficult to check estimates for consistency and to replicate earlier results. A separate database for data collection operations also makes it easier to implement a sound database design for operations. Data analysts prefer to restructure data to fit analytic procedures, and have little appreciation of data integrity constraints and data validation. Fortunately you do not have to choose between MS Access (or another DBMS) and SAS. SAS has particular value on the analytic side of your project(s). Access to a data source with a good relational database design guarantees that a SAS programmer can restructure data quickly and accurately into the structures that analysts ...

MS Access 2002
MS Access 2002 - query form control returns funny symbols like [][] I am running an append query on a form. Access is having trouble with the calculated fields and comboboxes. Example &#8211; referring to forms!FormName!ControlName within the query should return the value of that control, correct? I am receiving symbols such as boxes [] or [][] as well as Chinese symbols. Any thoughts as to why this is happening. thanks This happens if Access does not understand the data type of the calculated controls. Typecast the calculated fields, and set the Format of unbound controls. For ...

ODBC/OLE DB MS Access Question 10G Database Upgrade Issues?
Hi There We currently have the following setup: Server: Oracle Database on Unix @ 9.2 Client: Windows XP Pro (SP1) MS Access 2000 Microsoft ODBC Driver for Oracle pile of databases that connect to oracle via ODBC/OLE DB Oracle Client 8.1.7 (MSDTC keys are pointing at oracle 8 dll's) We will be upgrading our database to Oracle 10G, and are concerned that the connection between MS access and the database will fail, or we will have data issues. I have read some reports of this, but have seen no consistant data accross the board. Testing will be done of course, but sometimes its easy to ask first.... We will also (in time) look at upgrading the Oracle Client level (currently we only have done that for our developers/dba's), but I am concerned with Microsoft's ODBC/OLE DB drivers. Will I be forced to upgrade to the Oracle drivers? Will I be forced to upgrade the client (SQL*net) level? (I.e. oraclient10.dll) I also have a few other apps that require ODBC/OLE DB access including Powerbuilder and Crystal Reports. Thanks, Henry If your clients are at least 8.1.7 you should have no problem. We have servers and clients running from 8.0.4 to 10g. The only issue we now have is that the 10g folks can't talk to the 8.0 folks. Not quite true. Our parent Company still has some O7, and that is causing us problems with the 9i2 and 10g, but that is only a couple of dozen out of 5K users. In fact, I had MS tell me at one point that their ODBC/OLEDB is now base...

MS Access 2000 VBA Code Shows Totally Incorrect Date from Controls on a Form
Hi, Sorry for my English. English is not my native tougue. I am working in MS Access 2000 with a SQLServer 2000 Backend database. MS Access 2000 is my GUI front end that has SQLServer linked tables in it. One of my forms has two TEXT BOX controls formated as Short Date. The form is binded to a linked table. The linked tables has about 7 records and one of the control is binded to a table field. These two controls displays the date correctly as 01/07/2006 and 31/07/2006 (I am running Windows XP, my regional setting is set to English Australia, location is set to Australia, language for non-...

Access MS-ACCESS database on server from client????
I m currently developing a java based application and want to know how can i make client access database located on the server? "HeMan_Speaks" <Lunar20092010@gmail.com> wrote in message news:d71ce567-0434-48b8-b1d2-bb191706ab45@w8g2000prd.googlegroups.com... >I m currently developing a java based application and want to know how > can i make client access database located on the server? I think you're going to have to expand a little bit more in your question here, as is not 100% quite clear what you're trying to do. You might want to make a little bit of a distinction between MS access, the development system that allows you to write code, build forms, and build reports, and that of the database engine that you choose to use with MS access. When you build an application MS access, you then choose your database engine, that might be oracle, SQL server, or perhaps more often leave the default jet database. So when you say make a client access application, are you talking about a piece of software that you plan to install and each computer? The fact that your introducing the issue of java further complicates your question. Perhaps your question is simply you have some java code running on a server, and with to open a mdb file (an access database file). In this situation you're not really using MS access at all here (you using what is called the jet database engine to read that mdb file). For all the trouble in this type of sce...

request for explanation on access an database in ms access
This is the code that I found on the internet for accessing an ms access database: import java.sql.*; class Test { public static void main(String[] args) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); // set this to a MS Access DB you have on your machine String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end // now we can get the connection from the DriverManager Connection con = DriverManager.getConnection( database ,"",""); } catch (Exception e) { System.out.println("Error: " + e); } } } What I don't understand is the declaration of database. What I did was putting the database in the same dir as the sourcecode and use "jdbc:odbc:CafeJolt.mdb". But this doesn't work. And the above code does, why is that??? Actually it's not Java question. It's ODBC question. You have to have ODBC connection. Depending of Windows it's usually something like this (for my Windows 2000): Start->Sttings->Control Panel->Administartive Tools->Data Sources(ODBC)-> User DSN -> [Add]-> Driver to Microsoft Access(*.mdb) === And here, finally you can choose file name. ...

MATLAB command to access MS Access database
Hi! Is there a MATLAB command which gives access to a .mdb MS Access database or do I need a special driver? Thanks, Andree Hi Andree Ellert, you can use activeXcontrol to interact with MS-Access database. access = actxserver('Access.Application'); returns the handle for Access. set(access, 'Visible', 1); will show the opened Access window. use get(access) and set(access) commands to find the methods available to call. -Vadivelu M =========== http://www.mathworks.com/access/helpdesk/help/toolbox/database/datatool.shtml "Andree Ellert" <ellert@gmx.net/////\\\\\> wrote in message news:eed9874.-1@webx.raydaftYaTP... > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree Andree Ellert wrote: > > > Hi! > > Is there a MATLAB command which gives access to a .mdb MS Access > database or do I need a special driver? > > Thanks, > > Andree <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=4045&objectType=file> -Hardik ...

Accessing MS ACCESS database using Data Environment
HI, I have developped a program in Visual Basic 6.0 using MS Access database. I have created all my reports through Data Environment where I have entered the location of my database file (for e.g c:\project\app\test.mdb) in the Connection properties. I have installed my application on another PC using Package & Deployment wizard. When viewing the reports on the other PC, I have to enter everytime the new location of the database. How can I solve this problem, please? nadia wrote: > HI, > I have developped a program in Visual Basic 6.0 using MS Access database. >...

Running a ms access database with access 2003 in Vista
I have a Database that I am trying to run on a new vista computer. Up to now I was running it on a win 98 computer and using access 2003! I installed access 2003 and I can make it run and view the data but I can not save any new records. Has any one seen this problem yet? Thanks Clarence Wollman On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewollman@gmail.com> wrote: Do you have the same problem with the Northwind sample application? (search your computer for northwind.mdb) -Tom. >I have a Database that I am trying to run on a new vista computer. Up >to now I was running it on a win 98 computer and using access 2003! I >installed access 2003 and I can make it run and view the data but I >can not save any new records. >Has any one seen this problem yet? > >Thanks Clarence Wollman On Aug 22, 7:29 pm, Tom van Stiphout <no.spam.tom7...@cox.net> wrote: > On Wed, 22 Aug 2007 13:17:13 -0700, cwoll <clarencewoll...@gmail.com> > wrote: > > Do you have the same problem with the Northwind sample application? > (search your computer for northwind.mdb) I don't have a problem opening and editing the northwind.mdb. Thanks Hi I found a workaround. This database has a fronted and a backed. When I link them in the linked table manager, I was going threw the network to my computer. The reason I am doing this is when any networked computer opens the shortcut to the front end of this computer the linked table manger knows...

Best way to access a remote MS ACCESS database
What is the best way, via the internet, to access a remote Microsoft Access database? I was thinking of using VPN, but I thought that I would check here to see if there is a better way. Any suggestions? Thanks Do you mean remotely controlling an Access database, or linking tables over the internet? The first is doable, the second is a recipe for disaster. Remote Control: If your remote OS is Windows XP, you can use Remote Desktop (although only 1 person can access the PC at a time; this will change in the upcoming Service Pack for XP, but that may not help you now). Otherwise, GoToMyPC offers similar services, as does Terminal Server (a component of a Windows Server machine), PCAnywhere, et al. Linking to remote tables: You will almost certainly encounter severe problems with corruption, and your performance will almost certainly be so poor as to be unworkable. I attempted this once, with a web server in Canada and my machine in Augusta, GA. Even tiny data requests on a very well optimized data structure took waaaay too long to process ... it's simply not workable, IMO. Other alternatives would be covert the app to a web-based and place your data on a web server. Access/Jet isn't really designed for those workloads, but running a small site with minimal transactions and users can be done. Otherwsie, consider switching to a more robust data platform like MySQL, SQL Server, etc. -- Scott McDaniel CS Computer Software Visual Bas...

Database question, Vb6 SP5, DAO, Access database
I posted this message in a VB database newsgroup 5 days ago and have not received any answers. Since this newsgroup has been very supportive in VB, I am posting it here (with changes) in hopes of getting an answer. Jim Y Using a database is still new for me. I do not know all the terms, so I hope I can explain my question. I wrote a program in VB6 SP5 using DAO. It works with no known problems (yet), I had to add/modify the database and program to include an additional variable. This program has been installed on a friends PC with XP and I want to upgrade it with the new version. My que...

Accessing a MS Access database across two servers
Hi The technical support guys at my company have set up my system so that the server containing the MS Access database is on one server, while the pages that should access the database are on another server. When the pages and database are on the same server, I usually just connect through ODBC. The problem is that I don't know how to set up an ODBC connection to link from one server to a database in another. Anyone know what I am getting at and know of a possible solution, or a link to a site which may help. thanks in advance Brendan "Singularity" <Brendan.Collins@Sin...

MS Access database with a file extension of .mde
Good day: Can you kindly assist me in opening a MS Access database with a file extension of .mde? I get an error message stating "This database is in an unrecognized format". Any help is greatfull. TIA This usually indicates an attempt to open an Access 2000 database in an earlier version. -- MichKa [MS] NLS Collation/Locale/Keyboard Development Globalization Infrastructure and Font Technologies This posting is provided "AS IS" with no warranties, and confers no rights. "mary" <chloemelmom@yahoo.com> wrote in message news:a0a64947.0311151242.4df0c...

Making MS Access Form as a standalone form like in VB
Well, its sames difficult for me; I love access so much and wish to make it perform extra task. I prepared an HTML form but can not connect it to my access table and so I think it is possible to make an access form a standalone form for user input. Can anyone assist. My mail add is dianafather@aim.com. *** Sent via Developersdex http://www.developersdex.com *** Oscar, why don't you just code up a VB form for user input and connect it to an Access backend? To my knowledge, you can't force an Access form to exist outside of Access. Your users would have to open the Access file to ent...

how to access database control of many oracle10g database instances on same server
I am on Redhat Linux 9 and using Oracle 10G (10.0.1.3?). I know how to create a Oracle database instance and use EM database control to administer the database. To access database control from a browser, Oracle asks to enter a URL: http://server_name:5500/em The URL does not specify the ORACLE_SID. I however want to create several database instances on the same box. Will Oracle automatically set up a different port (e.g., 5501) for second instance. All the documentation I have found on Oracle's web site refers to a single database instance on a server. Appreciate any pointers. Thanks a lot, Prem You need to read about Grid Control. Actually when you create your database using DBCA, it should ask you whether you want to use Grid Control or DB Console. Jining Han Jining Han wrote: > You need to read about Grid Control. Actually when you create your > database using DBCA, it should ask you whether you want to use Grid > Control or DB Console. > > Jining Han I hae read about Grid Control, but I think there is still a way to access many instnaces on the same server using database control. Prem Of course you can, a DB Console for each database, and you can choose that as your preferred approach, too. But I really think it's a waste of resources and a big inconvenience. You are probably better off with the "tradictional" desktop console. Just my 2 cents. Jining Han <premmehrotra@hotmail.com> wrote in message news:...

Web resources about - Forms and Control Question - comp.databases.ms-access

German question - Wikipedia, the free encyclopedia
"Kleindeutschland" redirects here. For the neighborhood in New York City, see Little Germany, Manhattan . 1820 map of Central Europe showing ...

Salary expectations question: Best answers to give in a job interview
IT’S the awkward but crucial question in any job interview: “What are your salary expectations?”

Arnold Schwarzenegger terminates Weekend Sunrise interview after questions on US presidential campaign ...
He's famous for saying he'll be back, but Arnold Schwarzenegger may think twice about appearing on Weekend Sunrise again.

Arnold Schwarzenegger terminates Weekend Sunrise interview after questions on US presidential campaign ...
He's famous for saying he'll be back, but Arnold Schwarzenegger may think twice about appearing on Weekend Sunrise again.

NDP, Tories question whether PM's new Senate picks can be truly independent
Prime Minister Justin Trudeau is recommending the appointment of seven new senators. Although they will sit as independents, opposition MPs are ...

South Carolina police officer killed trying to question teen
A South Carolina police officer was shot and killed Friday as he and a partner were trying to question a self-professed gang member who they ...

"It’s a question every candidate for state Supreme Court is asked: Which U.S. Supreme Court justices ...
Writes the left/liberal Bill Lueders at the end of his Isthmus piece "Battle for the [Wisconsin Supreme] court/Bradley v. Kloppenburg is a classic ...

The question nobody dares to ask about strategy
Picture by Henrik Mårtensson I originally published this article at Linkedin Pulse : When I transitioned from my work as a developer and systems ...

17 former Google interview questions so ridiculous that the company banned them
Sometimes the hiring practices of even the most successful companies can feel outright wonky. There can be strange interview questions that ...

S.C. police officer killed trying to question teen
S.C. police officer killed trying to question teen

Resources last updated: 3/21/2016 12:36:36 AM