SESSION PROBLEM(improved version)

123456
123456 used Ask the Experts™
on
hello,

when I used the below instructions to create a alias at run time  this error was
happened :’session1:session name missing”

 MyList := TStringList.Create;
     try
       with  MyList  do
       begin
      Add('DATABASE NAME=F:\E DRIVE\univerwork\MYDOCU~1\progeh.mdb');
       end ;
   
     Session1.AddAlias('ham_rez','Microsoft Access Driver (*.mdb)', MyList);
   
finally
      MyList.Free;
End;
Table1.databasename:=’ham_rez’;  {1}
Table1.tablename:=’kar’;//table_ name    {2}    
Table1.open;                      {3}

with  guide of mnasman and pay attention to comment of  Kretscham( correct spell) I created a alias  but when I used it with these three instructions((1)(2)(3)) this error was happened:
“Invalid configuration parameter.Alias:ham_rez”
in ODBC DATA SOURCES(32bit) if I defined a alias(example:ham_rez) manually and used  it  with  (1),(2),(3) instructions in my application  I can to open it, but
why this operation is  not probably with these definitions( (1),(2),(3))?
How can I solve this problem?

Thanks a lot.


Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Software Developer
Commented:
Hello

  Assign name to the SessionName property of the Session component, or set the AutoSessionName to true

Best regards
Mohammed Nasman
Top Expert 2004

Commented:
hi,

it works for me with following change:

instead of
Session1.AddAlias('ham_rez','Microsoft Access   Driver (*.mdb)', MyList);

i use
Session1.AddAlias('ham_rez','Microsoft Access Driver (*.mdb)', MyList);

Author

Commented:
pay attention to my quetion again kretzschmar
Mohammed NasmanSoftware Developer

Commented:
Hello

  It's better to post comment about ur modification than to change the original questions, because that will confuse :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial