473,770 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Linking a text box and/or a list box to an Access table's column.

I have posted q couple questions about databinding, but figured I'd
simplify my questions and see if what I want to do is even possible.

I have a database C:\mydatase.mdb
In it there is a table tbleCategory
In that table are two fields fldCat and fldID.

I know how to use ASP and ADO to update a database at a click of a
button by sending dynamically created SQL to the database, but it seems
like there are new methods out there that would be better in that the
database would be aware of collisions (two users modifing data in a
field at the same time via a web page). Is this one of the powers that
databinding offers. If so, can I implement it. I have tried RDS and
..dot and get nothing. Not even an error with the code I am trying.

If I want to bind the Category name column in my database to a text
field, and allow the user to scroll through each record and make
changes, can this be done? Or should I simply continue to use basic
ASP? If it can be done, given the example below, what would the code
look like. Is it simple?

Here is code I tried with the NorthWind database that returned NO
values from the table:

Thanks,

<%@ Import Namespace="Syst em.Data.OleDb" %>

<script runat="server">
sub Page_Load
dim dbconn,sql,dbco mm,dbread
dbconn=New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;data
source=" & server.mappath( "C:/Program Files/Microsoft
Office/Office/Samples/northwind.mdb") )
dbconn.Open()
sql="SELECT * FROM customers"
dbcomm=New OleDbCommand(sq l,dbconn)
dbread=dbcomm.E xecuteReader()
customers.DataS ource=dbread
customers.DataB ind()
dbread.Close()
dbconn.Close()
end sub
</script>

<html>
<body>

<form runat="server">
<asp:DataList
id="customers"
runat="server"
cellpadding="2"
cellspacing="2"
borderstyle="in set"
backcolor="#e8e 8e8"
width="100%"
headerstyle-font-name="Verdana"
headerstyle-font-size="12pt"
headerstyle-horizontalalign ="center"
headerstyle-font-bold="True"
itemstyle-backcolor="#778 899"
itemstyle-forecolor="#fff fff"
footerstyle-font-size="9pt"
footerstyle-font-italic="True">

<HeaderTemplate >
Customers Table
</HeaderTemplate>

<ItemTemplate >
<%#Container.Da taItem("company name")%> in
<%#Container.Da taItem("address ")%>, <%#Container.Da taItem("city")% >
</ItemTemplate>

<FooterTemplate >
Source: Northwind Database
</FooterTemplate>

</asp:DataList>
</form>

</body>
</html>

Nov 19 '05 #1
0 1178

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
11440
by: Richard Hollenbeck | last post by:
To prevent future apostrophe bugs and errors, isn't it just simpler to forbid an apostrophe from being entered into a text field? For example, couldn't "Alice's Restaurant" be changed to "Alices Restaurant" etc. automatically and programmatically during data entry? This would eliminate my concatinated strings from producing errors when I base the string on a query. Think this is an example of the "Dreaded Apostrophe Bug." If I enter a...
1
4010
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the live databases on the network. Is there a way, via code, when I get back in-house from being on the road to click a button, and select the backends I want to link to? I would want to delete all the current links and link to the "live"
4
1461
by: Leon.Kemp | last post by:
I have a project that I am working on that will (ultimately) write to 2 Excel Spreadsheets, 3 Access databases, and communicates with 3 other programs (torque monitoring software, a laser rangefinder, and a specialized industrial inkjet printer). I had much of it working in VB6, but then upgraded (for reasons that I can no longer remember) to .NET. I am now having problems communicating to Access. The main form has 35 text boxes on it fo an...
4
2355
by: pointies | last post by:
I have a form with a ComboBox with a list of users. The ComboBox is set on a Table/Query to look up the Employee Names by their ID. The ComboBox is named AssignedTo If I set up a Textbox with =AssignedTo , it will just display the ID of the Employee. How do I go about so that this box will show the name instead? Thanks in advance
2
4206
by: mlb5000 | last post by:
I am creating a form that needs to read information from another table. The user selects a single value from a drop-down box that is linked to the first column of data in the table I want to read from. I then have two other objects that need to take the data from the corresponding fields of that record. For example. If the table looks like this
6
1845
by: oyk | last post by:
I hope someone could help me on this. I have linked an excel worksheet to access but the some data shown in the access table has the #Num errors. Presumably, this must be because the data in the particular column in excel are of mixed data-type. For example, there are numbers as well as texts like "abcd" etc. in the same columns I tried changing the cell format in excel to text but to no avail as the problem still exist. Really need...
2
2950
by: codeWarrior007 | last post by:
Hi, I created an access database with cascading combo boxes with the information for each combo box stored in separate tables. I wanted to put the database on SharePoint 2007 but when I put it up there, it made me get rid of my primary key and it inserted it's on "ID" primary key. Now instead of getting the text from the tables to populate the combo boxes, it get's the ID number. I have tried several things to get around this such as...
3
3164
by: ARC | last post by:
I'm having trouble here with Access 2007 and connecting to a different database. The code below works great IF the previous back-end database connection is still present and you are trying to connect to a new location (ie: datapath variable below). However, if you remove or even rename the old database, then launch your program, the code fails on the mytable.refreshlink line with an error 3044. (Description of that error is: 'C:\pc
7
3060
by: Salad | last post by:
I am converting an application from A97 to A2003. I have 2 tables created by another application as a Foxpro.dbf. The table has no index. The connect string in A97 is FoxPro 2.0;HDR=NO;IMEX=2;DATABASE=C:\Test It's really easy to connect to those tables in A97. I'm having difficulties in A2003. I'm trying to follow the instructions in http://support.microsoft.com/kb/824264/.
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.