VB6 DAO Connection to SQL Server 2008 Database
INTRODUCTION (tldr; question down below)
First off, yes I know DAO:
- is obsolete
- no longer supported
- inefficient for SQL
- sucks in general
So answers along those lines aren't helpful to the problem.
I've long since shifted my preferences to nHibernate and other means of connecting to data. However, I'm on a legacy project where the first stage of the plan is to migrate the data from many Access databases to a single SQL Server instance. Easy enough. The data migration has been done and works fine.
However, the application is VB6 code using DAO to connect to Access and I need to change this as minimally as possible for the first stage. The next phase (soon) is to convert the whole application to an ASP.MVC site hitting SQL properly.
As I search around for how to properly structure the DAO OpenDatabase() function to hit SQL Server, all the answers are the aforementioned "Why do you want to do that?" "You should learn ADODB!" "DAO is for suckers!" nonsense that never addresses the actual question asked. Sadly the original question remains in the search engine even though it's marked "solved" on particular forums, etc...
SO... THE QUESTION
Given all of this, is there ANYONE who still remembers how to connect to Sql Server using DAO OpenDatabase???
Yes, this is comparable to drilling a hole in a piece of wood with a brace and bit? Sure a power drill is better, smarter, faster, and all that goodness... but sometimes the old ways are required.
sql-server vb6 dao
|
show 8 more comments
INTRODUCTION (tldr; question down below)
First off, yes I know DAO:
- is obsolete
- no longer supported
- inefficient for SQL
- sucks in general
So answers along those lines aren't helpful to the problem.
I've long since shifted my preferences to nHibernate and other means of connecting to data. However, I'm on a legacy project where the first stage of the plan is to migrate the data from many Access databases to a single SQL Server instance. Easy enough. The data migration has been done and works fine.
However, the application is VB6 code using DAO to connect to Access and I need to change this as minimally as possible for the first stage. The next phase (soon) is to convert the whole application to an ASP.MVC site hitting SQL properly.
As I search around for how to properly structure the DAO OpenDatabase() function to hit SQL Server, all the answers are the aforementioned "Why do you want to do that?" "You should learn ADODB!" "DAO is for suckers!" nonsense that never addresses the actual question asked. Sadly the original question remains in the search engine even though it's marked "solved" on particular forums, etc...
SO... THE QUESTION
Given all of this, is there ANYONE who still remembers how to connect to Sql Server using DAO OpenDatabase???
Yes, this is comparable to drilling a hole in a piece of wood with a brace and bit? Sure a power drill is better, smarter, faster, and all that goodness... but sometimes the old ways are required.
sql-server vb6 dao
1
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
1
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
1
I used ODBC. So, here how I open SQL connection with DAO :connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
– DanB
Nov 12 at 19:10
1
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
1
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have usedSQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
– DanB
Nov 12 at 19:17
|
show 8 more comments
INTRODUCTION (tldr; question down below)
First off, yes I know DAO:
- is obsolete
- no longer supported
- inefficient for SQL
- sucks in general
So answers along those lines aren't helpful to the problem.
I've long since shifted my preferences to nHibernate and other means of connecting to data. However, I'm on a legacy project where the first stage of the plan is to migrate the data from many Access databases to a single SQL Server instance. Easy enough. The data migration has been done and works fine.
However, the application is VB6 code using DAO to connect to Access and I need to change this as minimally as possible for the first stage. The next phase (soon) is to convert the whole application to an ASP.MVC site hitting SQL properly.
As I search around for how to properly structure the DAO OpenDatabase() function to hit SQL Server, all the answers are the aforementioned "Why do you want to do that?" "You should learn ADODB!" "DAO is for suckers!" nonsense that never addresses the actual question asked. Sadly the original question remains in the search engine even though it's marked "solved" on particular forums, etc...
SO... THE QUESTION
Given all of this, is there ANYONE who still remembers how to connect to Sql Server using DAO OpenDatabase???
Yes, this is comparable to drilling a hole in a piece of wood with a brace and bit? Sure a power drill is better, smarter, faster, and all that goodness... but sometimes the old ways are required.
sql-server vb6 dao
INTRODUCTION (tldr; question down below)
First off, yes I know DAO:
- is obsolete
- no longer supported
- inefficient for SQL
- sucks in general
So answers along those lines aren't helpful to the problem.
I've long since shifted my preferences to nHibernate and other means of connecting to data. However, I'm on a legacy project where the first stage of the plan is to migrate the data from many Access databases to a single SQL Server instance. Easy enough. The data migration has been done and works fine.
However, the application is VB6 code using DAO to connect to Access and I need to change this as minimally as possible for the first stage. The next phase (soon) is to convert the whole application to an ASP.MVC site hitting SQL properly.
As I search around for how to properly structure the DAO OpenDatabase() function to hit SQL Server, all the answers are the aforementioned "Why do you want to do that?" "You should learn ADODB!" "DAO is for suckers!" nonsense that never addresses the actual question asked. Sadly the original question remains in the search engine even though it's marked "solved" on particular forums, etc...
SO... THE QUESTION
Given all of this, is there ANYONE who still remembers how to connect to Sql Server using DAO OpenDatabase???
Yes, this is comparable to drilling a hole in a piece of wood with a brace and bit? Sure a power drill is better, smarter, faster, and all that goodness... but sometimes the old ways are required.
sql-server vb6 dao
sql-server vb6 dao
edited Nov 27 at 16:33
asked Nov 12 at 18:51
klkitchens
54521136
54521136
1
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
1
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
1
I used ODBC. So, here how I open SQL connection with DAO :connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
– DanB
Nov 12 at 19:10
1
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
1
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have usedSQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
– DanB
Nov 12 at 19:17
|
show 8 more comments
1
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
1
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
1
I used ODBC. So, here how I open SQL connection with DAO :connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
– DanB
Nov 12 at 19:10
1
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
1
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have usedSQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
– DanB
Nov 12 at 19:17
1
1
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
1
1
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
1
1
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.– DanB
Nov 12 at 19:10
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.– DanB
Nov 12 at 19:10
1
1
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
1
1
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (
C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.– DanB
Nov 12 at 19:17
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (
C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.– DanB
Nov 12 at 19:17
|
show 8 more comments
2 Answers
2
active
oldest
votes
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now.
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>"
Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
add a comment |
I think one way you could do that isuse an ODBC connection.
On Administrative tools form control panel y can add an ODBC Source to you SQL Server.
After doing that, you could try this:
Dim worksp As Workspace
Dim conexString As String
Dim base As Variant
Set worksp = DBEngine.Workspaces(0)
Let conexString = "OBDC;DSN=SQLDNSNAME;UID=;PWD="
Set base = worksp.OpenDatabase("BDDNAME", False, False, conexString)
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268353%2fvb6-dao-connection-to-sql-server-2008-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now.
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>"
Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
add a comment |
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now.
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>"
Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
add a comment |
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now.
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>"
Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now.
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>"
Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (C:WindowsSysWOW64odbcad32.exe
). And I think I have used SQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.
answered Nov 12 at 19:34
DanB
1,3911114
1,3911114
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
add a comment |
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
Thank you... I did have the 64 bit ODBC setup and not 32 bit. That correction and the proper structure of the connectionstring were the keys. Instead of RDO and OpenConnection, was still able to use ADO and OpenDatabase to minimize my code changes.
– klkitchens
Nov 12 at 19:55
add a comment |
I think one way you could do that isuse an ODBC connection.
On Administrative tools form control panel y can add an ODBC Source to you SQL Server.
After doing that, you could try this:
Dim worksp As Workspace
Dim conexString As String
Dim base As Variant
Set worksp = DBEngine.Workspaces(0)
Let conexString = "OBDC;DSN=SQLDNSNAME;UID=;PWD="
Set base = worksp.OpenDatabase("BDDNAME", False, False, conexString)
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
add a comment |
I think one way you could do that isuse an ODBC connection.
On Administrative tools form control panel y can add an ODBC Source to you SQL Server.
After doing that, you could try this:
Dim worksp As Workspace
Dim conexString As String
Dim base As Variant
Set worksp = DBEngine.Workspaces(0)
Let conexString = "OBDC;DSN=SQLDNSNAME;UID=;PWD="
Set base = worksp.OpenDatabase("BDDNAME", False, False, conexString)
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
add a comment |
I think one way you could do that isuse an ODBC connection.
On Administrative tools form control panel y can add an ODBC Source to you SQL Server.
After doing that, you could try this:
Dim worksp As Workspace
Dim conexString As String
Dim base As Variant
Set worksp = DBEngine.Workspaces(0)
Let conexString = "OBDC;DSN=SQLDNSNAME;UID=;PWD="
Set base = worksp.OpenDatabase("BDDNAME", False, False, conexString)
I think one way you could do that isuse an ODBC connection.
On Administrative tools form control panel y can add an ODBC Source to you SQL Server.
After doing that, you could try this:
Dim worksp As Workspace
Dim conexString As String
Dim base As Variant
Set worksp = DBEngine.Workspaces(0)
Let conexString = "OBDC;DSN=SQLDNSNAME;UID=;PWD="
Set base = worksp.OpenDatabase("BDDNAME", False, False, conexString)
answered Nov 12 at 19:33
D. Hurtado
816
816
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
add a comment |
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
Thanks @D Hurtado... that would work too.
– klkitchens
Nov 12 at 19:53
1
1
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
You're Welcome, happy to help u
– D. Hurtado
Nov 12 at 20:00
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53268353%2fvb6-dao-connection-to-sql-server-2008-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I had to migrate recently a VB6 with DAO application from SQL7 to SQL 2016, and the process was almost straight forward. I didn't change anything in code, except old SQL Syntax that is obsolete now. So, what is your issue? Can you be more precise?
– DanB
Nov 12 at 19:00
1
It is difficult to provide useful information when you don't ask a very specific question. Saying "how do I structure ..." implies a question that is far too broad for SO. But if your question is along the lines of "how do I connect to a sql server database using dao OpenDatabase method", then it seems the doc has such an example. Is that not useful?
– SMor
Nov 12 at 19:02
1
I used ODBC. So, here how I open SQL connection with DAO :
connect = "DSN=<odbcname>;UID=<username>;PWD=<password>;DATABASE=<database>" Set datab = rdoEnvironments(0).OpenConnection("", rdDriverCompleteRequired, False, connect)
This is the solution for us, for having less changed to do in our old app. Note this is not the only way to do this.– DanB
Nov 12 at 19:10
1
Tell me before if this solve your issue.
– DanB
Nov 12 at 19:13
1
Remember you have to use 32 bits ODBC driver. If you are on 64 bits system, take the good one (
C:WindowsSysWOW64odbcad32.exe
). And I think I have usedSQL Server
driver. SQL Native client are too recent for DAO (I think). You may have to try many.– DanB
Nov 12 at 19:17