I have Microsoft Office InfoPath 2007, i have tried number of thing to solve this problem, and to do that i followed these following steps :
When I opened an application to design a form template using 'Database' option, creating a new Data Source pointing to a database in local SQL Server 2005, i keep the default template layout, as i have read in the blog I run the Drag one query field in the 'Query' layout table then have selected Select 'Preview' from the toolbar by entering the valued in the query field i received the following error message:
InfoPath cannot connect to a data source
when i again try to connect it to the data source it prompt me saying "Try to connect". To use previously used data, click "Work offline".