Skip to content

Commit ac54d8e

Browse files
committed
cherry picked an old post to try some new formatting on, got carried away
1 parent f6f2ed6 commit ac54d8e

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

_layouts/post.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ <h1 class="post-title p-name" itemprop="name headline">{{ page.title | escape }}
2222
<span class="p-author h-card" itemprop="name">{{ page.author }}</span>
2323
</span>
2424
{%- endif -%}
25+
&bullet;
26+
<span class="post-tags">
27+
tags: {{ page.tags | join: ", " }}
28+
</span>
2529
</p>
2630

2731
</header>

_posts/2011-03-30-4d-dsn-less-odbc-connection.md

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,45 @@
22
layout: post
33
author: James Rowe
44
title: "4D DSN-less ODBC connection"
5-
date: "2011-03-30 00:00:00 -0400"
6-
tags: 2011 wordpress txcowboycoder 4D odbc dsn configuration
5+
date: "2011-03-30 00:00:00 -0400"
6+
tags: 2011 wordpress txcowboycoder 4D odbc
77
uid: dc30133e-b5d9-4632-a423-f75a984cebd5
88
---
99

10-
1110
## 4D DSN-less ODBC connection
1211

12+
Took me forever to figure this out because the docs out there for 4D are minimal[^1] on connecting to the database without a system configured DSN using 4D's ODBC driver.
1313

14-
Took me forever to figure this out because the docs out there for 4D are minimal.
15-
16-
17-
Easy configuration of multiple data sources is crucial if you want to use CodeIgniter or any other framework that allows configuration files to control the deployment and connection to various databases.
18-
19-
20-
21-
22-
| `// get the connection resource``$connect` `= odbc_connect(``'DRIVER={4D v11 ODBC Driver};SSL=false;SERVER=192.168.1.100;PORT=19812;UID=user;PWD=password'``,``""``,``""``);` |
23-
| --- |
14+
Easy configuration of multiple data sources is crucial if you want to use `CodeIgniter` or any other framework that allows configuration files to control the deployment and connection to various databases.[^2]
2415

16+
```php
17+
// get the connection resource circa 2011 so php ~v5.x 4D's database default port was `19812`
18+
$connect=odbc_connect('DRIVER={4D v11 ODBC Driver};SSL=false;SERVER=192.168.1.100;PORT=19812;UID=user;PWD=password',"","");
19+
```
2520

2621
I played with various different ways of doing this connection string, and found the above the most straight forward. You can leave password blank if there isn’t one.
2722

23+
Now if only they would make a linux odbc driver...[^3]
2824

29-
Now if only they would make a linux odbc driver…
30-
25+
## DSN Configuration
3126

27+
If I recall correctly our `4D` instance was deployed on a Mac Server and `PHP` a `Windows IIS` server. So the DSN configuration would've had a dialog something like below.
3228

29+
<figure>
30+
<img src="/assets/posts-images/myodbc-macos-odbcadmin-main.png" alt="mac odbc admin" class="img-stylish"/>
31+
<figcaption>Credit: <a href="https://docs.oracle.com/cd/E17952_01/connector-odbc-en/connector-odbc-configuration-dsn-macos.html">Oracle documentation</a></figcaption>
32+
</figure>
33+
<figure>
34+
<img src="/assets/posts-images/actian-odbc-admin.png" alt="windows odbc driver" class="img-stylish"/>
35+
<figcaption>Credit: <a href="https://docs.actian.com/ingres/10s/index.html#page/Connectivity/Configure_a_Data_Source_(Windows).htm">Actian documentation</a></figcaption>
36+
</figure>
3337

3438
---
3539

3640
## Author's Note
3741

42+
In hindsight one of my more "popular" 4D/technology posts. [2024-05-27 comments screenshot](/assets/posts-images/4d-dsn-less-odbc-connection-comments.png)
43+
3844
Initial `md` Generated using [https://github.com/jsr6720/wordpress-html-scraper-to-md](https://github.com/jsr6720/wordpress-html-scraper-to-md)
3945

4046
Original Wordpress categories: ['4D']
@@ -47,8 +53,14 @@ Original Wordpress comments: <a href="https://txcowboycoder.wordpress.com/2011/0
4753

4854
tags: {{ page.tags | join: ", " }} <!-- todo move this somewhere -->
4955

50-
- {{ "2024-05-06 22:47:17" | date_to_string: "ordinal", "US" }} Converted to jekyll markdown format and copied to personal site
56+
- {{ "2024-05-27 01:13:57 -0400" | date_to_string: "ordinal", "US" }} Came in and updated content testing layout. Added original comments
57+
- {{ "2024-05-06 22:47:17 -0400" | date_to_string: "ordinal", "US" }} Converted to jekyll markdown format and copied to personal site
5158
- {{ page.date | date_to_string: "ordinal", "US" }} Originally published on [txcowboycoder wordpress site](https://txcowboycoder.wordpress.com/2011/03/30/4d-dsn-less-odbc-connection/)
5259

5360
## EOF/Footnotes
5461

62+
[^1]: Happy to report documentation is much more comprehensive now https://doc.4d.com/4Dv20/4D/20/Using-a-connection-string.200-6341904.en.html
63+
64+
[^2]: Configuration as code all the way back in 2011!
65+
66+
[^3]: Nope. 2024 no linux.
173 KB
Loading
46.6 KB
Loading
60.5 KB
Loading

0 commit comments

Comments
 (0)