I've tried to connect to mdf file, but with no success..
My connection string is like this
if i connect to the database, i have no problem, below is the code
The error with the code #1 produce is:
Can anyone please tell me what's wrong?
My connection string is like this
Code:
sCon = "Server =.\SQLEXPRESS;Integrated Security = true; AttachDbFilename" & _
" = E:\Project Koperasi\KOPERASI2.mdf; User Instance = true; Trusted_Connection=Yes;"
Set oCon = New ADODB.Connection
oCon.Open sCon
Code:
sCon = "Provider=SQLNCLI10;Server=DAVE-30E71AC775;Database=KOPERASI2;"
sCon = sCon & "Trusted_Connection=yes"
Set oCon = New ADODB.Connection
oCon.Open sCon
Code:
Run-time error '-2147217887 (80040e21)':
Multiple-step OLE DB operation generated errors. Check each OLE DB status
value, if available. No work was done.