Connecting InfoPath to databases

Learn how you can use InfoPath to retrieve data from or submit data to Access, MySQL, SQL Server, and other databases.

Introduction

You can use Receive and Submit data connections InfoPath to connect to several types of databases.

InfoPath has built-in support for only Access and SQL Server, but you can connect to other types of databases such as MySQL and Oracle through the use of a web service. This is a Universal Rule you should not forget if you happen to stumble upon this database limitation of InfoPath.

Access databases

Database record selection in InfoPath through a dropdown list box

Learn how to select an item from a dropdown list box, retrieve the database record corresponding to the item, and display the data in fields in InfoPath 2003.

Master/detail across views

Query and update records within a Microsoft Access database using master/detail functionality across two views in InfoPath 2003.

Query an Access database table in InfoPath by a list of numbers

Use JScript to perform a search to find only those records in a Microsoft Access table that correspond to a given comma-separated list of numbers.

Sequential database table record navigation

Move sequentially through the records of a Microsoft Access database table by clicking on [First], [Previous], [Next], and [Last] buttons.

Use an Access table as a secondary data source in a browser-compatible InfoPath form

Use Microsoft Access’ feature to link a table to a SharePoint list and then use this list as a secondary data source in a browser-compatible InfoPath form.

MySQL databases

How to get data from a MySQL database into InfoPath using a Web Service

This article shows you how to use a Microsoft .NET Web Service to retrieve data from a MySQL database and display the data in an InfoPath form.

How to submit data from an InfoPath form to a MySQL database using a Web Service

This article shows you how to use a Microsoft .NET Web Service to submit data from an InfoPath form to a MySQL database.

SQL Server databases

InfoPath does not support the specified database. The database must be a Microsoft SQL Server

Learn how to solve the InfoPath error: InfoPath does not support the specified database. The database must be a Microsoft SQL Server.

Retrieve an InfoPath form from SQL Server and display it in a new instance of InfoPath

Retrieve the XML value of the database field containing the InfoPath form, save it locally as a temporary file, and open it using this.Application.XmlForms.Open().

Retrieve an InfoPath form from SQL Server and display it in an InfoPath FormControl

Use code to retrieve the XML of an InfoPath form from SQL Server 2005, convert the InfoPath form into a MemoryStream object, and load this object into an InfoPath FormControl on a Windows Forms application.

Saving InfoPath Forms to SQL Server 2005 as XML External content

This article discusses and demonstrates how to save entire InfoPath forms to SQL Server 2005 as typed or untyped XML data.

Using a Receive data connection in InfoPath to execute an SQL Server stored procedure

Learn how to temporarily change the Command property of a Receive data connection in InfoPath to execute a SQL Server stored procedure and insert data into a database table.

Working with InfoPath