TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Amsterdammed on June 15, 2010, 12:32:03 PM

Title: MSSQL and VLisp
Post by: Amsterdammed on June 15, 2010, 12:32:03 PM
Hello everybody,

I'm working with a new vertical and they use a dbase in MSSQL, and I can't work it out with the Fleming group stuff.

I want to extend that vertical with useful things (as I dud with the other I work with for another client). Therefore I would need to read from and write to that dbase. This is what I have on information


Provider :  System.Data.SqlClient

Connectionstring : Server=(local)\SQLExpress;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=TechlineSQL

Schema : dbo.


Does any body know how i can get access to that dbase?

Thanks in Advance

Bernd

Title: Re: MSSQL and VLisp
Post by: HasanCAD on June 16, 2010, 05:45:02 AM
Check this one http://www.theswamp.org/index.php?topic=28286.0 (http://www.theswamp.org/index.php?topic=28286.0)
Title: Re: MSSQL and VLisp
Post by: kpblc on June 18, 2010, 01:36:10 AM
Another way: http://www.fleming-group.com/
Title: Re: MSSQL and VLisp
Post by: Kerry on June 18, 2010, 02:09:28 AM
Another way: http://www.fleming-group.com/

because Microsoft have not released a 64 bit version of the Jet Driver ADO.LSP will not work in an AutoCAD 64bit System.
Title: Re: MSSQL and VLisp
Post by: kpblc on June 18, 2010, 02:21:47 AM
Oops... Thank you for information.
Title: Re: MSSQL and VLisp
Post by: It's Alive! on June 18, 2010, 02:35:40 AM
Actually, I am pretty sure you can connect to MSSQL server if you use its provider. something like

"Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;"
Title: Re: MSSQL and VLisp
Post by: It's Alive! on June 18, 2010, 04:22:15 AM
this quick test works to connect

Code: [Select]
(defun c:doit ( / )
(vl-load-com)
(setq co (vlax-create-object "ADODB.Connection"))
(vlax-invoke-method co 'open 
"Provider=SQLNCLI10;Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\Daniel\\Desktop\\meserver.mdf;Initial Catalog=meserver;Integrated Security=SSPI;"
"" "" nil)
)
Title: Re: MSSQL and VLisp
Post by: Amsterdammed on June 25, 2010, 06:04:39 AM
Daniel,

sorry, i was trapped in drafting work and had no time to develop things. I checked your approach but get folling error

Quote
Foutmelding :Automation Error. Provider cannot be found. It may not be properly install

according to the info box in my vertical the provider should be

Quote
System.Data.SqlClient

to me this is all unknown territory, so i very much relay on setting it up once with the Swamps intel and then go from there, but i can't troubleshoot due to lack of sql knowledge.

Bernd
Title: Re: MSSQL and VLisp
Post by: It's Alive! on June 25, 2010, 07:06:29 AM
what version of MSSQL are you running?
Title: Re: MSSQL and VLisp
Post by: Amsterdammed on June 25, 2010, 07:28:28 AM
Daniel,
good Question, it came with the vertical... Mircosoft SQL Server 2005 is that the MySQL, because that is all i can find.

Bernd
Title: Re: MSSQL and VLisp
Post by: It's Alive! on June 25, 2010, 07:33:38 AM
I'm just guessing here but try SQLNCLI instead of SQLNCLI10
Title: Re: MSSQL and VLisp
Post by: Amsterdammed on June 25, 2010, 07:52:28 AM
Daniel,

you are the man, your guess was right. Connection works, no i have to find out how i can work with the data....

Thanks a lot!!

Bernd

Title: Re: MSSQL and VLisp
Post by: It's Alive! on June 25, 2010, 08:00:45 AM
If you have the connection string, just get in there and try modifying what's in Mr. Fleming's code  :-)
Title: Re: MSSQL and VLisp
Post by: Amsterdammed on June 25, 2010, 08:20:48 AM
right,

that is what i did before in Access as well, and he, it works great! It is not about knowledge alone these days, it is about to now where to find it.......

Title: Re: MSSQL and VLisp
Post by: Amsterdammed on July 09, 2010, 03:31:03 AM
Daniel,
a new problem came up. This all works fine, now i see that the vertical uses the same dbase, and i can't not connect to it because it is already open.

Can i disconnect the connecting running at the time and reconnect myself?



Thanks,

bernd