Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remote Views (Access)
Message
 
To
08/04/2003 15:03:18
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00775086
Message ID:
00775225
Views:
25
Henry,

Per yours
>lnConnect = SqlConnect([FinConnect]) && this reprompts me for a database; >why ?

I believe it is because it still refers to [Access FinData] that does not have database. Yes, yours
? DBGetProp([FinConnect],"CONNECTION","Database")
returns [C:\Temp\Lookup1.mdb]. And if you go to (modi data, connection, modify), it will show the proper database name. Even so if you try to verify connection, it will prompt you for database.

Perhaps this will meet your needs:

LCDEFA=SYS(5)+CURDIR()

store SQLSTRINGCONNECT(;
'DefaultDir=c:\;'+;
'Driver={Microsoft Access Driver (*.mdb)}');
TO gnConnHandle

SET DEFA TO &LCDEFA

create data hi
CREATE CONNECTION FinConnect CONNSTRING (;
sqlgetprop(gnConnHandle,"COnnectSTring"))
...


>Hi Yuri,
>
>Thank you very much for your reply.
>
>> Instead of ([Access FinData]) you need a valid datasource name as it is in > the ODBC ini file.
>
>'Access FinData' IS a valid datasource that I've created. It uses the Access driver but leaves the Database empty. There are no UserID or PW.
>
>I tried your code. It prompts me 3 times.
>
>My problem is not in a bad connection name; it is in subsequent calls re-prompting for a database even though the database has been specified for the connection:
>
>==================================
>xxx = [C:\Temp\Lookup1.mdb]
>Create Connection FinConnect ;
> DataSource [Access FinData] ;
> Database (xxx)
>? DBGetProp([FinConnect],"CONNECTION","Database") && returns [C:\Temp\Lookup1.mdb]
>
>* Create a connection handle for the SqlTables command
>lnConnect = SqlConnect([FinConnect]) && this reprompts me for a database; why ?
>===================================
>Remember, I NEVER get the datasource/connection prompt. I keep getting prompted for an mdb. It is the only prompt that I'm trying to get rid of.
>
>Again, thanks for your help. I hope we can see this through.
>
>Henry
Previous
Reply
Map
View

Click here to load this message in the networking platform