You would need to understand SQL Views and basic SQL syntax to implement the below suggestion.
PART 1 - be able to query the SQL table with 'parameters'
You can 'emulate' a web-service type effect with a secondary data connection to your SQL database.
- Create a 'receive data' secondary data connection to your 'Client Info' table (which I assume has their logonId as a field/unique key)
- Use a filter on the logonid field and put a sample logonid value in it
- have a look at the 'SQL' that Infopath uses for that data connection (you can see it by pressing 'Edit SQL' in the data connection wizard in IP2003
You will see somewhere in that 'SQL' the clause for filtering the data by the logonId you entered. - Manually replace it with a 'placeholder' like <inputLogonId>
- Save the data connection
Now the 'QueryString' value of the dataconnection will hold the 'SQL' you saw earlier - you can use JScript or VBScript behind the form to alter this value (replace the <inputLogonId> with the value of the logged on user.) and query the secondary data-connection.
This *might* roughly match how you've done it already - where the user inputs their userId and their details are returned back.
PART 2 - Send the logonId and retrieve data on form open.
The 'tricky' part might be how you determine the logonId of the user of the form. I've used a couple of methods:
1. Use JScript/VBScript and retrieve the users UserName environment variable, or NetworkObject's user properties.
2. Use SQL Server to 'identify' the user.
If your SQL server uses Windows Authentication for its connections then the user sends their logonId to the SQL server whenever a query is run.
- Set up a 'View' on the server which purely holds a single field value - the 'USER' function in SQL.
Not exactly sure on the SQL but it might be as simple as just "SELECT USER" as the View definition.
- Set up a secondary data connection in Infopath to this View
- Query it immediately the user opens the forms (Open rules) and the returned value will be their LogonId !
- Query the UserInfo secondary data connection from Part 1 with the returned value
Hope this gives you some more ideas - I came up with these methods because I had no scope in my business role to create Web-Services or other methodologies.